Created
August 31, 2018 06:30
-
-
Save felixmosh/c8110a93ef55a0a52bd369b23f88e525 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// libsass (v3.5.4) | |
// ---- | |
$themes: ( | |
light: ( | |
text: black | |
), | |
dark: ( | |
text: white | |
) | |
); | |
@mixin themify($prop, $key, $themeList: $themes) { | |
@each $themeName ,$theme in $themeList { | |
$value: map-get($theme, $key); | |
.#{$value} { | |
#{$prop}: $value; | |
} | |
} | |
} | |
.foo { | |
display: flex; | |
@include themify('color', 'text'); | |
} |
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
.foo { | |
display: flex; | |
} | |
.foo .black { | |
color: black; | |
} | |
.foo .white { | |
color: white; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment