Last active
August 8, 2016 21:55
Star
You must be signed in to star a gist
Use Scss map and map_get to get dynamic variables from map.
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
$white_foo_bar: #FFF; | |
$map: ( | |
foo: 'foo', | |
bar: 'bar', | |
baz: 'white', | |
foowhite: 'foowhitecolor' | |
); | |
@mixin foo($type) { | |
.foo { | |
.bar { | |
background: $white_foo_bar; | |
color: map-get($map, #{$type}white); | |
} | |
} | |
} | |
.div { | |
@include foo('foo'); | |
} |
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
.div .foo .bar { | |
background: #FFF; | |
color: "foowhitecolor"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment