Skip to content

Instantly share code, notes, and snippets.

@felixmosh
Created August 31, 2018 06:30
Show Gist options
  • Save felixmosh/c8110a93ef55a0a52bd369b23f88e525 to your computer and use it in GitHub Desktop.
Save felixmosh/c8110a93ef55a0a52bd369b23f88e525 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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');
}
.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