Skip to content

Instantly share code, notes, and snippets.

@fatihacet
Last active August 8, 2016 21:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fatihacet/a5aa48d19fa0579c698c94ebcac08679 to your computer and use it in GitHub Desktop.
Use Scss map and map_get to get dynamic variables from map.
$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');
}
.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