web-map/src/assets/themes/_theme.scss

24 lines
402 B
SCSS
Raw Normal View History

2025-05-01 01:07:16 +08:00
@use 'sass:map';
@use './dark' as dark;
@use './light' as light;
$themes: (dark, light);
$theme-map: (
dark-color: dark.$color,
light-color: light.$color,
);
@mixin themed {
@each $theme in $themes {
$theme-color: map.get($theme-map, #{$theme}-color) !global;
:root[theme='#{$theme}'] {
@content;
}
}
}
@function get-color($key) {
@return map.get($theme-color, $key);
}