mirror of
https://github.com/picocss/pico.git
synced 2025-04-27 03:36:13 -04:00
refactor: update $css-var-prefix name
This commit is contained in:
parent
2c97dc3ae5
commit
3c96e6043b
41 changed files with 866 additions and 759 deletions
|
@ -6,121 +6,129 @@
|
|||
|
||||
// Default: Dark theme
|
||||
@mixin theme {
|
||||
#{$✨}background-color: #{mix($slate-950, $slate-900)};
|
||||
#{$css-var-prefix}background-color: #{mix($slate-950, $slate-900)};
|
||||
|
||||
// Text color
|
||||
#{$✨}color: #{$zinc-200};
|
||||
#{$css-var-prefix}color: #{$zinc-200};
|
||||
|
||||
// Text selection color
|
||||
#{$✨}text-selection-color: #{rgba($azure-350, 0.1875)};
|
||||
#{$css-var-prefix}text-selection-color: #{rgba($azure-350, 0.1875)};
|
||||
|
||||
// Muted colors
|
||||
#{$✨}muted-color: #{$zinc-450};
|
||||
#{$✨}muted-border-color: #{$slate-850};
|
||||
#{$css-var-prefix}muted-color: #{$zinc-450};
|
||||
#{$css-var-prefix}muted-border-color: #{$slate-850};
|
||||
|
||||
// Primary colors
|
||||
#{$✨}primary: #{$azure-350};
|
||||
#{$✨}primary-background: #{$azure-550};
|
||||
#{$✨}primary-border: var(#{$✨}primary-background);
|
||||
#{$✨}primary-underline: #{rgba($azure-350, 0.5)};
|
||||
#{$✨}primary-hover: #{$azure-250};
|
||||
#{$✨}primary-hover-background: #{$azure-500};
|
||||
#{$✨}primary-hover-border: var(#{$✨}primary-hover-background);
|
||||
#{$✨}primary-hover-underline: var(#{$✨}primary-hover);
|
||||
#{$✨}primary-focus: #{rgba($azure-350, 0.375)};
|
||||
#{$✨}primary-inverse: #{$white};
|
||||
#{$css-var-prefix}primary: #{$azure-350};
|
||||
#{$css-var-prefix}primary-background: #{$azure-550};
|
||||
#{$css-var-prefix}primary-border: var(#{$css-var-prefix}primary-background);
|
||||
#{$css-var-prefix}primary-underline: #{rgba($azure-350, 0.5)};
|
||||
#{$css-var-prefix}primary-hover: #{$azure-250};
|
||||
#{$css-var-prefix}primary-hover-background: #{$azure-500};
|
||||
#{$css-var-prefix}primary-hover-border: var(#{$css-var-prefix}primary-hover-background);
|
||||
#{$css-var-prefix}primary-hover-underline: var(#{$css-var-prefix}primary-hover);
|
||||
#{$css-var-prefix}primary-focus: #{rgba($azure-350, 0.375)};
|
||||
#{$css-var-prefix}primary-inverse: #{$white};
|
||||
|
||||
// Secondary colors
|
||||
#{$✨}secondary: #{$zinc-350};
|
||||
#{$✨}secondary-background: #{$slate-600};
|
||||
#{$✨}secondary-border: var(#{$✨}secondary-background);
|
||||
#{$✨}secondary-underline: #{rgba($zinc-350, 0.5)};
|
||||
#{$✨}secondary-hover: #{$zinc-250};
|
||||
#{$✨}secondary-hover-background: #{$slate-550};
|
||||
#{$✨}secondary-hover-border: var(#{$✨}secondary-hover-background);
|
||||
#{$✨}secondary-hover-underline: var(#{$✨}secondary-hover);
|
||||
#{$✨}secondary-focus: #{rgba($slate-350, 0.25)};
|
||||
#{$✨}secondary-inverse: #{$white};
|
||||
#{$css-var-prefix}secondary: #{$zinc-350};
|
||||
#{$css-var-prefix}secondary-background: #{$slate-600};
|
||||
#{$css-var-prefix}secondary-border: var(#{$css-var-prefix}secondary-background);
|
||||
#{$css-var-prefix}secondary-underline: #{rgba($zinc-350, 0.5)};
|
||||
#{$css-var-prefix}secondary-hover: #{$zinc-250};
|
||||
#{$css-var-prefix}secondary-hover-background: #{$slate-550};
|
||||
#{$css-var-prefix}secondary-hover-border: var(#{$css-var-prefix}secondary-hover-background);
|
||||
#{$css-var-prefix}secondary-hover-underline: var(#{$css-var-prefix}secondary-hover);
|
||||
#{$css-var-prefix}secondary-focus: #{rgba($slate-350, 0.25)};
|
||||
#{$css-var-prefix}secondary-inverse: #{$white};
|
||||
|
||||
// Contrast colors
|
||||
#{$✨}contrast: #{$slate-100};
|
||||
#{$✨}contrast-background: #{$slate-50};
|
||||
#{$✨}contrast-border: var(#{$✨}contrast-background);
|
||||
#{$✨}contrast-underline: #{rgba($slate-100, 0.5)};
|
||||
#{$✨}contrast-hover: #{$white};
|
||||
#{$✨}contrast-hover-background: #{$white};
|
||||
#{$✨}contrast-hover-border: var(#{$✨}contrast-hover-background);
|
||||
#{$✨}contrast-hover-underline: var(#{$✨}contrast-hover);
|
||||
#{$✨}contrast-focus: #{rgba($slate-150, 0.25)};
|
||||
#{$✨}contrast-inverse: #{$black};
|
||||
#{$css-var-prefix}contrast: #{$slate-100};
|
||||
#{$css-var-prefix}contrast-background: #{$slate-50};
|
||||
#{$css-var-prefix}contrast-border: var(#{$css-var-prefix}contrast-background);
|
||||
#{$css-var-prefix}contrast-underline: #{rgba($slate-100, 0.5)};
|
||||
#{$css-var-prefix}contrast-hover: #{$white};
|
||||
#{$css-var-prefix}contrast-hover-background: #{$white};
|
||||
#{$css-var-prefix}contrast-hover-border: var(#{$css-var-prefix}contrast-hover-background);
|
||||
#{$css-var-prefix}contrast-hover-underline: var(#{$css-var-prefix}contrast-hover);
|
||||
#{$css-var-prefix}contrast-focus: #{rgba($slate-150, 0.25)};
|
||||
#{$css-var-prefix}contrast-inverse: #{$black};
|
||||
|
||||
// Box shadow
|
||||
#{$✨}box-shadow: box-shadow.shadow($black);
|
||||
#{$css-var-prefix}box-shadow: box-shadow.shadow($black);
|
||||
|
||||
// Typography
|
||||
@if map.get($modules, "content/typography") {
|
||||
// Headings colors
|
||||
#{$✨}h1-color: #{$zinc-50};
|
||||
#{$✨}h2-color: #{$zinc-100};
|
||||
#{$✨}h3-color: #{$zinc-200};
|
||||
#{$✨}h4-color: #{$zinc-250};
|
||||
#{$✨}h5-color: #{$zinc-300};
|
||||
#{$✨}h6-color: #{$zinc-400};
|
||||
#{$css-var-prefix}h1-color: #{$zinc-50};
|
||||
#{$css-var-prefix}h2-color: #{$zinc-100};
|
||||
#{$css-var-prefix}h3-color: #{$zinc-200};
|
||||
#{$css-var-prefix}h4-color: #{$zinc-250};
|
||||
#{$css-var-prefix}h5-color: #{$zinc-300};
|
||||
#{$css-var-prefix}h6-color: #{$zinc-400};
|
||||
|
||||
// Highlighted text (<mark>)
|
||||
#{$✨}mark-background-color: #{$azure-750};
|
||||
#{$✨}mark-color: #{$white};
|
||||
#{$css-var-prefix}mark-background-color: #{$azure-750};
|
||||
#{$css-var-prefix}mark-color: #{$white};
|
||||
|
||||
// Inserted (<ins>) & Deleted (<del>)
|
||||
#{$✨}ins-color: #{mix($jade-450, $zinc-200)};
|
||||
#{$✨}del-color: #{mix($red-500, $zinc-200)};
|
||||
#{$css-var-prefix}ins-color: #{mix($jade-450, $zinc-200)};
|
||||
#{$css-var-prefix}del-color: #{mix($red-500, $zinc-200)};
|
||||
|
||||
// Blockquote
|
||||
#{$✨}blockquote-border-color: var(#{$✨}muted-border-color);
|
||||
#{$✨}blockquote-footer-color: var(#{$✨}muted-color);
|
||||
#{$css-var-prefix}blockquote-border-color: var(#{$css-var-prefix}muted-border-color);
|
||||
#{$css-var-prefix}blockquote-footer-color: var(#{$css-var-prefix}muted-color);
|
||||
}
|
||||
|
||||
// Button
|
||||
@if map.get($modules, "content/button") {
|
||||
// To disable box-shadow, remove the var or set to '0 0 0 rgba(0, 0, 0, 0)'
|
||||
// Don't use, 'none, 'false, 'null', '0', etc.
|
||||
#{$✨}button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
#{$✨}button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
#{$css-var-prefix}button-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
#{$css-var-prefix}button-hover-box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Table
|
||||
@if map.get($modules, "content/table") {
|
||||
#{$✨}table-border-color: var(#{$✨}muted-border-color);
|
||||
#{$✨}table-row-stripped-background-color: #{rgba($zinc-500, 0.0375)};
|
||||
#{$css-var-prefix}table-border-color: var(#{$css-var-prefix}muted-border-color);
|
||||
#{$css-var-prefix}table-row-stripped-background-color: #{rgba($zinc-500, 0.0375)};
|
||||
}
|
||||
|
||||
// Code
|
||||
@if map.get($modules, "content/code") {
|
||||
#{$✨}code-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
#{$✨}code-color: #{$zinc-400};
|
||||
#{$✨}code-kbd-background-color: var(#{$✨}color);
|
||||
#{$✨}code-kbd-color: var(#{$✨}background-color);
|
||||
#{$css-var-prefix}code-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
#{$css-var-prefix}code-color: #{$zinc-400};
|
||||
#{$css-var-prefix}code-kbd-background-color: var(#{$css-var-prefix}color);
|
||||
#{$css-var-prefix}code-kbd-color: var(#{$css-var-prefix}background-color);
|
||||
}
|
||||
|
||||
// Form elements
|
||||
@if map.get($modules, "forms/basics") {
|
||||
#{$✨}form-element-background-color: #{mix($slate-900, $slate-850)};
|
||||
#{$✨}form-element-selected-background-color: #{$slate-800};
|
||||
#{$✨}form-element-border-color: #{$slate-800};
|
||||
#{$✨}form-element-color: #{$zinc-100};
|
||||
#{$✨}form-element-placeholder-color: #{$zinc-400};
|
||||
#{$✨}form-element-active-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
#{$✨}form-element-active-border-color: var(#{$✨}primary-border);
|
||||
#{$✨}form-element-focus-color: var(#{$✨}primary-border);
|
||||
#{$✨}form-element-disabled-background-color: var(#{$✨}form-element-background-color);
|
||||
#{$✨}form-element-disabled-border-color: var(#{$✨}form-element-border-color);
|
||||
#{$✨}form-element-disabled-opacity: 0.5;
|
||||
#{$✨}form-element-invalid-border-color: #{mix($red-500, $slate-600)};
|
||||
#{$✨}form-element-invalid-active-border-color: #{mix($red-500, $slate-600, 75%)};
|
||||
#{$✨}form-element-invalid-focus-color: var(#{$✨}form-element-invalid-active-border-color);
|
||||
#{$✨}form-element-valid-border-color: #{mix($jade-450, $slate-600)};
|
||||
#{$✨}form-element-valid-active-border-color: #{mix($jade-450, $slate-600, 75%)};
|
||||
#{$✨}form-element-valid-focus-color: var(#{$✨}form-element-valid-active-border-color);
|
||||
#{$css-var-prefix}form-element-background-color: #{mix($slate-900, $slate-850)};
|
||||
#{$css-var-prefix}form-element-selected-background-color: #{$slate-800};
|
||||
#{$css-var-prefix}form-element-border-color: #{$slate-800};
|
||||
#{$css-var-prefix}form-element-color: #{$zinc-100};
|
||||
#{$css-var-prefix}form-element-placeholder-color: #{$zinc-400};
|
||||
#{$css-var-prefix}form-element-active-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
#{$css-var-prefix}form-element-active-border-color: var(#{$css-var-prefix}primary-border);
|
||||
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-border);
|
||||
#{$css-var-prefix}form-element-disabled-background-color: var(
|
||||
#{$css-var-prefix}form-element-background-color
|
||||
);
|
||||
#{$css-var-prefix}form-element-disabled-border-color: var(
|
||||
#{$css-var-prefix}form-element-border-color
|
||||
);
|
||||
#{$css-var-prefix}form-element-disabled-opacity: 0.5;
|
||||
#{$css-var-prefix}form-element-invalid-border-color: #{mix($red-500, $slate-600)};
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color: #{mix($red-500, $slate-600, 75%)};
|
||||
#{$css-var-prefix}form-element-invalid-focus-color: var(
|
||||
#{$css-var-prefix}form-element-invalid-active-border-color
|
||||
);
|
||||
#{$css-var-prefix}form-element-valid-border-color: #{mix($jade-450, $slate-600)};
|
||||
#{$css-var-prefix}form-element-valid-active-border-color: #{mix($jade-450, $slate-600, 75%)};
|
||||
#{$css-var-prefix}form-element-valid-focus-color: var(
|
||||
#{$css-var-prefix}form-element-valid-active-border-color
|
||||
);
|
||||
|
||||
// Focus for buttons, radio and select
|
||||
input:is(
|
||||
|
@ -131,71 +139,71 @@
|
|||
[type="radio"],
|
||||
[type="file"]
|
||||
) {
|
||||
#{$✨}form-element-focus-color: var(#{$✨}primary-focus);
|
||||
#{$css-var-prefix}form-element-focus-color: var(#{$css-var-prefix}primary-focus);
|
||||
}
|
||||
}
|
||||
|
||||
// Switch (input[type="checkbox"][role="switch"])
|
||||
@if map.get($modules, "forms/checkbox-radio-switch") {
|
||||
#{$✨}switch-background-color: #{$slate-750};
|
||||
#{$✨}switch-color: var(#{$✨}primary-inverse);
|
||||
#{$✨}switch-checked-background-color: var(#{$✨}primary-background);
|
||||
#{$css-var-prefix}switch-background-color: #{$slate-750};
|
||||
#{$css-var-prefix}switch-color: var(#{$css-var-prefix}primary-inverse);
|
||||
#{$css-var-prefix}switch-checked-background-color: var(#{$css-var-prefix}primary-background);
|
||||
}
|
||||
|
||||
// Range (input[type="range"])
|
||||
@if map.get($modules, "forms/input-range") {
|
||||
#{$✨}range-border-color: #{$slate-850};
|
||||
#{$✨}range-active-border-color: #{$slate-800};
|
||||
#{$✨}range-thumb-border-color: var(#{$✨}background-color);
|
||||
#{$✨}range-thumb-color: var(#{$✨}secondary-background);
|
||||
#{$✨}range-thumb-active-color: var(#{$✨}primary-background);
|
||||
#{$css-var-prefix}range-border-color: #{$slate-850};
|
||||
#{$css-var-prefix}range-active-border-color: #{$slate-800};
|
||||
#{$css-var-prefix}range-thumb-border-color: var(#{$css-var-prefix}background-color);
|
||||
#{$css-var-prefix}range-thumb-color: var(#{$css-var-prefix}secondary-background);
|
||||
#{$css-var-prefix}range-thumb-active-color: var(#{$css-var-prefix}primary-background);
|
||||
}
|
||||
|
||||
// Accordion (<details>)
|
||||
@if map.get($modules, "components/accordion") {
|
||||
#{$✨}accordion-border-color: var(#{$✨}muted-border-color);
|
||||
#{$✨}accordion-active-summary-color: var(#{$✨}primary-hover);
|
||||
#{$✨}accordion-close-summary-color: var(#{$✨}color);
|
||||
#{$✨}accordion-open-summary-color: var(#{$✨}muted-color);
|
||||
#{$css-var-prefix}accordion-border-color: var(#{$css-var-prefix}muted-border-color);
|
||||
#{$css-var-prefix}accordion-active-summary-color: var(#{$css-var-prefix}primary-hover);
|
||||
#{$css-var-prefix}accordion-close-summary-color: var(#{$css-var-prefix}color);
|
||||
#{$css-var-prefix}accordion-open-summary-color: var(#{$css-var-prefix}muted-color);
|
||||
}
|
||||
|
||||
// Card (<article>)
|
||||
@if map.get($modules, "components/card") {
|
||||
#{$✨}card-background-color: #{$slate-900};
|
||||
#{$✨}card-border-color: var(#{$✨}card-background-color);
|
||||
#{$✨}card-box-shadow: var(#{$✨}box-shadow);
|
||||
#{$✨}card-sectioning-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
#{$css-var-prefix}card-background-color: #{$slate-900};
|
||||
#{$css-var-prefix}card-border-color: var(#{$css-var-prefix}card-background-color);
|
||||
#{$css-var-prefix}card-box-shadow: var(#{$css-var-prefix}box-shadow);
|
||||
#{$css-var-prefix}card-sectioning-background-color: #{mix($slate-900, $slate-850, 75%)};
|
||||
}
|
||||
|
||||
// Dropdown (details.dropdown)
|
||||
@if map.get($modules, "components/dropdown") and $enable-classes {
|
||||
#{$✨}dropdown-background-color: #{$slate-900};
|
||||
#{$✨}dropdown-border-color: #{$slate-850};
|
||||
#{$✨}dropdown-box-shadow: var(#{$✨}box-shadow);
|
||||
#{$✨}dropdown-color: var(#{$✨}color);
|
||||
#{$✨}dropdown-hover-background-color: #{$slate-850};
|
||||
#{$css-var-prefix}dropdown-background-color: #{$slate-900};
|
||||
#{$css-var-prefix}dropdown-border-color: #{$slate-850};
|
||||
#{$css-var-prefix}dropdown-box-shadow: var(#{$css-var-prefix}box-shadow);
|
||||
#{$css-var-prefix}dropdown-color: var(#{$css-var-prefix}color);
|
||||
#{$css-var-prefix}dropdown-hover-background-color: #{$slate-850};
|
||||
}
|
||||
|
||||
// Loading ([aria-busy=true])
|
||||
@if map.get($modules, "components/loading") {
|
||||
#{$✨}loading-spinner-opacity: 0.5;
|
||||
#{$css-var-prefix}loading-spinner-opacity: 0.5;
|
||||
}
|
||||
|
||||
// Modal (<dialog>)
|
||||
@if map.get($modules, "components/modal") {
|
||||
#{$✨}modal-overlay-background-color: #{rgba(mix($black, $zinc-950), 0.75)};
|
||||
#{$css-var-prefix}modal-overlay-background-color: #{rgba(mix($black, $zinc-950), 0.75)};
|
||||
}
|
||||
|
||||
// Progress
|
||||
@if map.get($modules, "components/progress") {
|
||||
#{$✨}progress-background-color: #{$slate-850};
|
||||
#{$✨}progress-color: var(#{$✨}primary-background);
|
||||
#{$css-var-prefix}progress-background-color: #{$slate-850};
|
||||
#{$css-var-prefix}progress-color: var(#{$css-var-prefix}primary-background);
|
||||
}
|
||||
|
||||
// Tooltip ([data-tooltip])
|
||||
@if map.get($modules, "components/tooltip") {
|
||||
#{$✨}tooltip-background-color: var(#{$✨}contrast-background);
|
||||
#{$✨}tooltip-color: var(#{$✨}contrast-inverse);
|
||||
#{$css-var-prefix}tooltip-background-color: var(#{$css-var-prefix}contrast-background);
|
||||
#{$css-var-prefix}tooltip-color: var(#{$css-var-prefix}contrast-inverse);
|
||||
}
|
||||
|
||||
// Chevron icons
|
||||
|
@ -216,8 +224,8 @@
|
|||
|
||||
// Form validation icons
|
||||
@if map.get($modules, "forms/basics") {
|
||||
#{$✨}icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($jade-450, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
||||
#{$✨}icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($red-500, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
||||
#{$css-var-prefix}icon-valid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($jade-450, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
||||
#{$css-var-prefix}icon-invalid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='#{functions.display-rgb(mix($red-500, $slate-600))}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
// Loading icon (animated)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue