Last active
December 26, 2023 15:14
-
-
Save dmitru/39245f9e702dad9b04d504c549fc1814 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import 'themes.scss'; | |
@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; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function themed($key) { | |
@return map-get($theme-map, $key); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If this isn't working apply the className to body element.