2020-08-26 12:10:24 +02:00
|
|
|
// create variables for all colours
|
|
|
|
@mixin raw-color-names {
|
|
|
|
@each $name, $value in $colors {
|
|
|
|
--clr-#{$name}: #{$value};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// map the raw colours to abstract names in standard color mode
|
|
|
|
// we map the colour values here to prepare for dark mode
|
|
|
|
// with these mapping we express the _design intention_ rather than the colour value
|
|
|
|
@mixin color-scheme-light {
|
|
|
|
--clr-primary: var(--clr-red);
|
|
|
|
--clr-secondary: var(--clr-green);
|
|
|
|
--clr-foreground: var(--clr-black);
|
|
|
|
--clr-foreground-transparent: var(--clr-black-transparent);
|
|
|
|
--clr-background: white;
|
|
|
|
--clr-accent: var(--clr-pink);
|
|
|
|
--clr-border-main: var(--clr-dark-grey);
|
|
|
|
|
|
|
|
--clr-positive: var(--clr-green);
|
|
|
|
--clr-positive-text: var(--clr-dark-green);
|
|
|
|
--clr-positive-background: var(--clr-pale-green);
|
|
|
|
|
|
|
|
--clr-warning: var(--clr-yellow);
|
|
|
|
--clr-warning-background: var(--clr-pale-yellow);
|
|
|
|
--clr-warning-text: var(--clr-dark-yellow);
|
|
|
|
|
|
|
|
--clr-avoid: var(--clr-red);
|
|
|
|
--clr-avoid-background: var(--clr-pink);
|
|
|
|
--clr-avoid-text: var(--clr-dark-red);
|
|
|
|
}
|
|
|
|
|
|
|
|
// update colors which need to change in dark mode
|
|
|
|
@mixin color-scheme-dark {
|
|
|
|
--clr-foreground: var(--clr-light-grey);
|
|
|
|
--clr-foreground-transparent: var(--clr-white-transparent);
|
|
|
|
--clr-background: var(--clr-black);
|
|
|
|
--clr-accent: var(--clr-berry);
|
|
|
|
|
|
|
|
--clr-positive-text: var(--clr-pale-green);
|
|
|
|
--clr-positive-background: var(--clr-dark-green);
|
|
|
|
|
|
|
|
--clr-warning-background: var(--clr-dark-yellow);
|
|
|
|
--clr-warning-text: var(--clr-pale-yellow);
|
|
|
|
|
|
|
|
--clr-avoid-background: var(--clr-dark-red);
|
|
|
|
--clr-avoid-text: var(--clr-pink);
|
|
|
|
}
|
|
|
|
|
2020-02-20 08:38:32 +11:00
|
|
|
:root {
|
2020-08-26 12:10:24 +02:00
|
|
|
@include raw-color-names();
|
|
|
|
|
|
|
|
@include color-scheme-light();
|
|
|
|
|
2020-02-20 08:38:32 +11:00
|
|
|
--auto-grid-min-size: 17rem;
|
|
|
|
--l-gap: 1rem;
|
2020-03-07 11:23:05 -07:00
|
|
|
}
|
2020-08-26 12:10:24 +02:00
|
|
|
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
|
|
:root:not([data-user-theme='light']) {
|
|
|
|
@include color-scheme-dark();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
:root[data-user-theme='dark'] {
|
|
|
|
@include color-scheme-dark();
|
|
|
|
}
|