pico/scss/themes/default/_dark.scss
2023-03-08 11:47:37 +07:00

243 lines
12 KiB
SCSS

@use "sass:map";
@use "../../colors" as *;
@use "../../settings" as *;
@use "../../utils/box-shadow";
@use "../../utils/functions";
// Default: Dark theme
@mixin theme {
#{$✨}background-color: #{mix($slate-950, $slate-900)};
// Text color
#{$✨}color: #{$zinc-200};
// Text selection color
#{$✨}text-selection-color: #{rgba($azure-350, 0.1875)};
// Muted colors
#{$✨}muted-color: #{$zinc-450};
#{$✨}muted-border-color: #{$slate-850};
// Primary colors
#{$✨}primary: #{$azure-350};
#{$✨}primary-hover: #{$azure-250};
#{$✨}primary-underline: #{rgba($azure-350, 0.5)};
#{$✨}primary-underline-hover: var(#{$}primary-hover);
#{$✨}primary-background: #{$azure-550};
#{$✨}primary-background-hover: #{$azure-500};
#{$✨}primary-border: var(#{$}primary-background);
#{$✨}primary-border-hover: var(#{$}primary-background-hover);
#{$✨}primary-focus: #{rgba($azure-350, 0.375)};
#{$✨}primary-inverse: #{$white};
// Secondary colors
#{$✨}secondary: #{$zinc-350};
#{$✨}secondary-hover: #{$zinc-250};
#{$✨}secondary-underline: #{rgba($zinc-350, 0.5)};
#{$✨}secondary-underline-hover: var(#{$}secondary-hover);
#{$✨}secondary-background: #{$slate-600};
#{$✨}secondary-background-hover: #{$slate-550};
#{$✨}secondary-border: var(#{$}secondary-background);
#{$✨}secondary-border-hover: var(#{$}secondary-background-hover);
#{$✨}secondary-focus: #{rgba($slate-350, 0.25)};
#{$✨}secondary-inverse: #{$white};
// Contrast colors
#{$✨}contrast: #{$slate-100};
#{$✨}contrast-hover: #{$white};
#{$✨}contrast-underline: #{rgba($slate-100, 0.5)};
#{$✨}contrast-underline-hover: var(#{$}contrast-hover);
#{$✨}contrast-background: #{$slate-50};
#{$✨}contrast-background-hover: #{$white};
#{$✨}contrast-border: var(#{$}contrast-background);
#{$✨}contrast-border-hover: var(#{$}contrast-background-hover);
#{$✨}contrast-focus: #{rgba($slate-150, 0.25)};
#{$✨}contrast-inverse: #{$black};
// Box shadow
#{$✨}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};
// Highlighted text (<mark>)
#{$✨}mark-background-color: #{$azure-750};
#{$✨}mark-color: #{$white};
// Inserted (<ins>) & Deleted (<ins>)
#{$✨}ins-color: #{desaturate($jade-350, 25%)};
#{$✨}del-color: #{desaturate($red-400, 25%)};
// Blockquote
#{$✨}blockquote-border-color: var(#{$}muted-border-color);
#{$✨}blockquote-footer-color: var(#{$}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);
}
// Table
@if map.get($modules, "content/table") {
#{$✨}table-border-color: var(#{$}muted-border-color);
#{$✨}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: var(#{$}muted-color);
#{$✨}code-kbd-background-color: var(#{$}color);
#{$✨}code-kbd-color: var(#{$}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: #{desaturate($red-400, 25%)};
#{$✨}form-element-invalid-active-border-color: #{desaturate($red-500, 25%)};
#{$✨}form-element-invalid-focus-color: var(#{$}form-element-invalid-active-border-color);
#{$✨}form-element-valid-border-color: #{desaturate($jade-350, 25%)};
#{$✨}form-element-valid-active-border-color: #{desaturate($jade-450, 25%)};
#{$✨}form-element-valid-focus-color: var(#{$}form-element-valid-active-border-color);
// Focus for buttons, radio and select
input:is(
[type="submit"],
[type="button"],
[type="reset"],
[type="checkbox"],
[type="radio"],
[type="file"]
) {
#{$✨}form-element-focus-color: var(#{$}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);
}
// 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-hover-color: var(#{$}secondary-background-hover);
#{$✨}range-thumb-active-color: var(#{$}primary);
}
// 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);
}
// 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-sectionning-background-color: #{mix($slate-900, $slate-850, 75%)};
}
// Dropdown (<details role="list">)
@if map.get($modules, "components/dropdown") {
#{$✨}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};
}
// Loading ([aria-busy=true])
@if map.get($modules, "components/loading") {
#{$✨}loading-spinner-opacity: 0.5;
}
// Modal (<dialog>)
@if map.get($modules, "components/modal") {
#{$✨}modal-overlay-background-color: #{rgba(mix($black, $zinc-950), 0.85)};
}
// Progress
@if map.get($modules, "components/progress") {
#{$✨}progress-background-color: #{$slate-850};
#{$✨}progress-color: var(#{$}primary-background);
}
// Tooltip ([data-tooltip])
@if map.get($modules, "components/tooltip") {
#{$✨}tooltip-background-color: var(#{$}contrast-background);
#{$✨}tooltip-color: var(#{$}contrast-inverse);
}
// Checkboxes icons
@if map.get($modules, "forms/checkbox-radio-switch") {
#{$✨}icon-checkbox: 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($white)}' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
#{$✨}icon-minus: 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($white)}' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
}
// Chevron icons
@if map.get($modules, "forms/basics") or
map.get($modules, "components/accordion") or
map.get($modules, "components/dropdown")
{
#{$✨}icon-chevron: 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($zinc-400)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
#{$✨}icon-chevron-button: 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($white)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
#{$✨}icon-chevron-button-contrast: 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($black)}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
// Datetime icons
@if map.get($modules, "forms/input-date") {
#{$✨}icon-date: 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($zinc-400)}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
#{$✨}icon-time: 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($zinc-400)}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
}
// 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(desaturate($jade-350, 25%))}' 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(desaturate($red-400, 25%))}' 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");
}
// Search icon
@if map.get($modules, "forms/input-search") {
#{$✨}icon-search: 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($zinc-400)}' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}
// Close icon
@if map.get($modules, "components/modal") {
#{$✨}icon-close: 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($zinc-400)}' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}
// Document
color-scheme: dark;
}