Simple variable overrides for stylesheets (fixes #55)

This commit is contained in:
daudix
2024-08-26 05:39:42 +03:00
parent 58e4507229
commit cb58a187bd

View File

@ -1,5 +1,22 @@
@mixin theme-variables($theme) { @mixin theme-variables {
:root {
@content("light");
}
[data-theme="dark"] {
@content("dark");
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
@content("dark");
}
}
}
@include theme-variables using ($theme) {
@if $theme =="dark" { @if $theme =="dark" {
// COLORS
--bg-color: linear-gradient(rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.9)); --bg-color: linear-gradient(rgb(0 0 0 / 0.9), rgb(0 0 0 / 0.9));
--fg-color: rgb(255 255 255); --fg-color: rgb(255 255 255);
--fg-muted-1: rgb(255 255 255 / 0.05); --fg-muted-1: rgb(255 255 255 / 0.05);
@ -25,6 +42,7 @@
} }
@else { @else {
// COLORS
--bg-color: linear-gradient(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.8)); --bg-color: linear-gradient(rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.8));
--fg-color: rgb(0 0 0 / 0.8); --fg-color: rgb(0 0 0 / 0.8);
--fg-muted-1: rgb(0 0 0 / 0.05); --fg-muted-1: rgb(0 0 0 / 0.05);
@ -46,50 +64,36 @@
--red-fg: rgb(224 27 36); --red-fg: rgb(224 27 36);
--yellow-bg: rgb(156 110 3 / 0.1); --yellow-bg: rgb(156 110 3 / 0.1);
--yellow-fg: rgb(156 110 3); --yellow-fg: rgb(156 110 3);
}
} // VARIABLES
--active: 0.9;
:root { --blur: saturate(180%) blur(0.75rem);
@include theme-variables("light"); --container-width: 720px;
--edge-highlight: inset 0 0.0625rem 0 rgb(255 255 255 / 0.1);
// VARIABLES --rounded-corner-small: 0.5rem;
--active: 0.9; --rounded-corner: 0.75rem;
--blur: saturate(180%) blur(0.75rem); --shadow-raised: 0 0 0 0.0625rem rgb(0 0 0 / 0.06), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 0.14), 0 0.25rem 0.75rem 0.25rem rgb(0 0 0 / 0.06);
--container-width: 720px; --shadow: 0 0 0 0.0625rem rgb(0 0 0 / 0.03), 0 0.0625rem 0.1875rem 0.0625rem rgb(0 0 0 / 0.07), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 0.03);
--edge-highlight: inset 0 0.0625rem 0 rgb(255 255 255 / 0.1); --transition-long: 0.8s;
--rounded-corner-small: 0.5rem; --transition-longer: 0.4s;
--rounded-corner: 0.75rem; --transition: 0.2s;
--shadow-raised: 0 0 0 0.0625rem rgb(0 0 0 / 0.06), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 0.14), 0 0.25rem 0.75rem 0.25rem rgb(0 0 0 / 0.06);
--shadow: 0 0 0 0.0625rem rgb(0 0 0 / 0.03), 0 0.0625rem 0.1875rem 0.0625rem rgb(0 0 0 / 0.07), 0 0.125rem 0.375rem 0.125rem rgb(0 0 0 / 0.03); // FONTS
--transition-long: 0.8s; --font-system-ui: system-ui, sans-serif;
--transition-longer: 0.4s; --font-transitional: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif;
--transition: 0.2s; --font-old-style: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
--font-humanist: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif;
// FONTS --font-geometric-humanist: Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif;
--font-system-ui: system-ui, sans-serif; --font-classical-humanist: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif;
--font-transitional: Charter, "Bitstream Charter", "Sitka Text", Cambria, serif; --font-neo-grotesque: Inter, Roboto, "Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif;
--font-old-style: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif; --font-monospace-slab-serif: "Nimbus Mono PS", "Courier New", monospace;
--font-humanist: Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif; --font-monospace-code: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
--font-geometric-humanist: Avenir, Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif; --font-industrial: Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif;
--font-classical-humanist: Optima, Candara, "Noto Sans", source-sans-pro, sans-serif; --font-rounded-sans: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT", "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif;
--font-neo-grotesque: Inter, Roboto, "Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif; --font-slab-serif: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif;
--font-monospace-slab-serif: "Nimbus Mono PS", "Courier New", monospace; --font-antique: Superclarendon, "Bookman Old Style", "URW Bookman", "URW Bookman L", "Georgia Pro", Georgia, serif;
--font-monospace-code: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace; --font-didone: Didot, "Bodoni MT", "Noto Serif Display", "URW Palladio L", P052, Sylfaen, serif;
--font-industrial: Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif; --font-handwritten: "Segoe Print", "Bradley Hand", Chilanka, TSCu_Comic, casual, cursive;
--font-rounded-sans: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT", "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif; --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--font-slab-serif: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif;
--font-antique: Superclarendon, "Bookman Old Style", "URW Bookman", "URW Bookman L", "Georgia Pro", Georgia, serif;
--font-didone: Didot, "Bodoni MT", "Noto Serif Display", "URW Palladio L", P052, Sylfaen, serif;
--font-handwritten: "Segoe Print", "Bradley Hand", Chilanka, TSCu_Comic, casual, cursive;
--font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
[data-theme="dark"] {
@include theme-variables("dark");
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
@include theme-variables("dark");
} }
} }