Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $theme:(
- theme1: (width: 10px),
- theme2: (width: 20px)
- )
- @include loopTheme($theme) {
- <!-- ***** below code DOEST NOT work *****-->
- width: calc(#{map-get($theme, "width")} + 1px);
- <!-- this approach works -->
- width: map-get($theme, "width")
- }
- @mixin loopTheme($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;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement