Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----
- // libsass (v3.2.5)
- // ----
- // Colors.
- $blue: #0099CE;
- $green: #39B54A;
- $orange: #EB8F2D;
- $pink: #C1167A;
- $purple: #6D13B0;
- $navy: #1B1464;
- $themes: (
- "highlight-color__blue": ("color": $blue),
- "highlight-color__pink": ("color": $pink),
- "highlight-color__orange": ("color": $orange),
- "highlight-color__green": ("color": $green),
- "highlight-color__navy": ("color": $navy),
- "highlight-color__purple": ("color": $purple)
- );
- @function map-fetch($map, $keys) {
- $key: nth($keys, 1);
- $length: length($keys);
- $value: map-get($map, $key);
- @if $value != null {
- @if $length > 1 {
- $rest: ();
- @for $i from 2 through $length {
- $rest: append($rest, nth($keys, $i))
- }
- @return map-fetch($value, $rest);
- } @else {
- @return $value;
- }
- } @else {
- @return false;
- }
- }
- @mixin themify ($themes: $themes) {
- @each $theme, $map in $themes {
- .#{$theme} & {
- // Define theme color
- $theme-color: map-fetch($themes, $theme "color") !global;
- // ... other vars to use
- @content;
- // Reset theme color to null
- $theme-color: null !global;
- }
- }
- }
- h1 {
- @include themify() {
- color: $theme-color;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement