Anki/sass/_root-vars.scss
2022-11-01 15:29:28 +01:00

51 lines
1.3 KiB
SCSS

/* Copyright: Ankitects Pty Ltd and contributors
* License: GNU AGPL, version 3 or later, http://www.gnu.org/licenses/agpl.html */
@use "sass:map";
@use "vars" as *;
@use "functions" as *;
/*! Colors in HEX or RGBA format */
:root {
color: red;
$colors: map.get($vars, colors);
@each $name, $val in create-vars-from-map($colors, light) {
@if str-index($name, "comment") == 1 {
/*! #{$val} */
} @else {
#{$name}: #{$val};
}
}
color-scheme: light;
&.night-mode {
@each $name, $val in create-vars-from-map($colors, dark) {
@if str-index($name, "comment") == 1 {
/*! #{$val} */
} @else {
#{$name}: #{$val};
}
}
color-scheme: dark;
}
}
/*! Properties like lengths or percentages */
:root {
$props: map.get($vars, props);
@each $name, $val in create-vars-from-map($props, light) {
@if str-index($name, "comment") == 1 {
/*! #{$val} */
} @else {
#{$name}: #{$val};
}
}
&.night-mode {
@each $name, $val in create-vars-from-map($props, dark) {
@if str-index($name, "comment") == 1 {
/*! #{$val} */
} @else {
#{$name}: #{$val};
}
}
}
}