mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
62 lines
1.2 KiB
SCSS
62 lines
1.2 KiB
SCSS
@import "light";
|
|
@import "dark";
|
|
|
|
$themes: (
|
|
dark: $theme_dark,
|
|
light: $theme_light,
|
|
);
|
|
|
|
@mixin themify($themes: $themes) {
|
|
@each $theme, $map in $themes {
|
|
|
|
.theme-#{$theme} & {
|
|
$theme-map: () !global;
|
|
@each $key, $submap in $map {
|
|
$value: map-get(map-get($themes, $theme), '#{$key}');
|
|
$theme-map: map-merge($theme-map, ($key: $value)) !global;
|
|
}
|
|
|
|
@content;
|
|
$theme-map: null !global;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
@mixin themifyRoot($themes: $themes) {
|
|
@each $theme, $map in $themes {
|
|
|
|
.theme-#{$theme} {
|
|
$theme-map: () !global;
|
|
@each $key, $submap in $map {
|
|
$value: map-get(map-get($themes, $theme), '#{$key}');
|
|
$theme-map: map-merge($theme-map, ($key: $value)) !global;
|
|
}
|
|
|
|
@content;
|
|
$theme-map: null !global;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
@mixin themifyComponent($themes: $themes) {
|
|
@each $theme, $map in $themes {
|
|
|
|
:host-context(.theme-#{$theme}) {
|
|
$theme-map: () !global;
|
|
@each $key, $submap in $map {
|
|
$value: map-get(map-get($themes, $theme), '#{$key}');
|
|
$theme-map: map-merge($theme-map, ($key: $value)) !global;
|
|
}
|
|
|
|
@content;
|
|
$theme-map: null !global;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
@function themed($key) {
|
|
@return map-get($theme-map, $key);
|
|
} |