do frontend (preact)
This commit is contained in:
121
web/src/styles/_variables.scss
Normal file
121
web/src/styles/_variables.scss
Normal file
@@ -0,0 +1,121 @@
|
||||
@use 'sass:color';
|
||||
|
||||
$radius: 1em;
|
||||
$spacing-unit: 0.25rem;
|
||||
$transition: 0.36s cubic-bezier(0.16, 1, 0.3, 1);
|
||||
|
||||
:root {
|
||||
--radius: #{$radius};
|
||||
--radius-xs: calc(#{$radius} / 4);
|
||||
--transition: #{$transition};
|
||||
--spacing-unit: #{$spacing-unit};
|
||||
}
|
||||
|
||||
@mixin generate-shades($colors) {
|
||||
@each $name, $value in $colors {
|
||||
--#{$name}-400: #{color.adjust($value, $lightness: 10%)};
|
||||
--#{$name}-500: #{$value};
|
||||
--#{$name}: #{$value};
|
||||
--#{$name}-600: #{color.adjust($value, $lightness: -10%)};
|
||||
}
|
||||
}
|
||||
|
||||
@mixin light-theme() {
|
||||
color-scheme: light;
|
||||
|
||||
--background: #f4eff0;
|
||||
--surface: #fcfafa;
|
||||
--surface-muted: #e9e1e3;
|
||||
|
||||
$primary: #007336;
|
||||
$secondary: #6b6700;
|
||||
$accent: #4f6f8f;
|
||||
|
||||
$link: #2b64a6;
|
||||
$link-visited: #6a4c9c;
|
||||
$error: #b3261e;
|
||||
|
||||
$golden-star: #a97c00;
|
||||
$silver-star: #7283c6;
|
||||
|
||||
$text: #333138;
|
||||
$text-muted: #6b6469;
|
||||
|
||||
--border: #d4c5c7;
|
||||
|
||||
@include generate-shades((primary: $primary,
|
||||
secondary: $secondary,
|
||||
accent: $accent,
|
||||
text: $text,
|
||||
text-muted: $text-muted,
|
||||
|
||||
link: $link,
|
||||
link-visited: $link-visited,
|
||||
error: $error,
|
||||
|
||||
golden-star: $golden-star,
|
||||
silver-star: $silver-star,
|
||||
));
|
||||
}
|
||||
|
||||
@mixin dark-theme() {
|
||||
color-scheme: dark;
|
||||
|
||||
--background: #28262c;
|
||||
--surface: #333138;
|
||||
--surface-muted: #3f3c44;
|
||||
|
||||
$primary: #3fb872;
|
||||
$secondary: #b5ae3a;
|
||||
$accent: #8fb0cf;
|
||||
|
||||
$link: #7fb0e6;
|
||||
$link-visited: #b79fe0;
|
||||
$error: #f28b82;
|
||||
|
||||
$golden-star: #e6c04a;
|
||||
$silver-star: #a8b8f0;
|
||||
|
||||
$text: #f1eaeb;
|
||||
$text-muted: #b3a8ac;
|
||||
|
||||
--border: #4d4a54;
|
||||
|
||||
@include generate-shades((primary: $primary,
|
||||
secondary: $secondary,
|
||||
accent: $accent,
|
||||
text: $text,
|
||||
text-muted: $text-muted,
|
||||
|
||||
link: $link,
|
||||
link-visited: $link-visited,
|
||||
error: $error,
|
||||
|
||||
golden-star: $golden-star,
|
||||
silver-star: $silver-star,
|
||||
));
|
||||
}
|
||||
|
||||
[data-theme='light'] {
|
||||
@include light-theme();
|
||||
}
|
||||
|
||||
[data-theme='dark'] {
|
||||
@include dark-theme();
|
||||
}
|
||||
|
||||
:root {
|
||||
@include dark-theme();
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
@include light-theme();
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
@include dark-theme();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user