Skip to content

Instantly share code, notes, and snippets.

@dmitru
Last active December 26, 2023 15:14
Show Gist options
  • Save dmitru/39245f9e702dad9b04d504c549fc1814 to your computer and use it in GitHub Desktop.
Save dmitru/39245f9e702dad9b04d504c549fc1814 to your computer and use it in GitHub Desktop.
@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;
}
}
}
@function themed($key) {
@return map-get($theme-map, $key);
}
@Giuseppetm
Copy link

Giuseppetm commented Dec 26, 2023

If this isn't working apply the className to body element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment