Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $theme:(
  2. theme1: (width: 10px),
  3. theme2: (width: 20px)
  4. )
  5.  
  6. @include loopTheme($theme) {
  7. <!-- ***** below code DOEST NOT work *****-->
  8. width: calc(#{map-get($theme, "width")} + 1px);
  9.  
  10. <!-- this approach works -->
  11. width: map-get($theme, "width")
  12.  
  13. }
  14.  
  15.  
  16. @mixin loopTheme($themes: $themes) {
  17.  
  18. @each $theme,
  19. $map in $themes {
  20.  
  21. .theme-#{$theme} & {
  22. $theme-map: () !global;
  23.  
  24. @each $key,
  25. $submap in $map {
  26. $value: map-get(map-get($themes, $theme), '#{$key}');
  27. $theme-map: map-merge($theme-map, ($key: $value)) !global;
  28. }
  29.  
  30. @content;
  31. $theme-map: null !global;
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement