Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. // ----
  2. // libsass (v3.2.5)
  3. // ----
  4.  
  5. // Colors.
  6. $blue: #0099CE;
  7. $green: #39B54A;
  8. $orange: #EB8F2D;
  9. $pink: #C1167A;
  10. $purple: #6D13B0;
  11. $navy: #1B1464;
  12.  
  13. $themes: (
  14. "highlight-color__blue": ("color": $blue),
  15. "highlight-color__pink": ("color": $pink),
  16. "highlight-color__orange": ("color": $orange),
  17. "highlight-color__green": ("color": $green),
  18. "highlight-color__navy": ("color": $navy),
  19. "highlight-color__purple": ("color": $purple)
  20. );
  21.  
  22. @function map-fetch($map, $keys) {
  23. $key: nth($keys, 1);
  24. $length: length($keys);
  25. $value: map-get($map, $key);
  26.  
  27. @if $value != null {
  28. @if $length > 1 {
  29. $rest: ();
  30.  
  31. @for $i from 2 through $length {
  32. $rest: append($rest, nth($keys, $i))
  33. }
  34.  
  35. @return map-fetch($value, $rest);
  36.  
  37. } @else {
  38. @return $value;
  39. }
  40. } @else {
  41. @return false;
  42. }
  43. }
  44.  
  45. @mixin themify ($themes: $themes) {
  46. @each $theme, $map in $themes {
  47. .#{$theme} & {
  48. // Define theme color
  49. $theme-color: map-fetch($themes, $theme "color") !global;
  50. // ... other vars to use
  51.  
  52. @content;
  53.  
  54. // Reset theme color to null
  55. $theme-color: null !global;
  56. }
  57. }
  58. }
  59.  
  60. h1 {
  61. @include themify() {
  62. color: $theme-color;
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement