Advertisement
Guest User

Untitled

a guest
May 28th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. /**************************************************
  2. * Variables
  3. *************************************************/
  4.  
  5. $themes:
  6. (firmensuche, #34495e),
  7. (wien, #e30613),
  8. (immobilienwohnen, #995d41),
  9. (kunstkultur, #53375b),
  10. (veranstaltungen, #097e80),
  11. (freizeit, #3576be),
  12. (gesundheit, #16a086),
  13. (lifestyle, #ec8e0e),
  14. (bildung, #d25400),
  15. (politik, #95a5a5);
  16.  
  17. $util-farben:
  18. (fallback, #666),
  19. (dunkelgrau, #666),
  20. (mittelgrau, #acacac),
  21. (hellgrau, #e5e5e5),
  22. (rot, #da0015),
  23. (hellrot, #f30017),
  24. (facebook, #3B579D),
  25. (twitter, #399ad6),
  26. (googleplus, #b61a22);
  27.  
  28. $farben: join($themes, $util-farben);
  29.  
  30. $highlight-amount: 5%;
  31.  
  32.  
  33. /**************************************************
  34. * Functions
  35. *************************************************/
  36.  
  37. @function lookup($list, $key, $default:null) {
  38. @if length($list) == 0 {
  39. @return $default;
  40. }
  41.  
  42. @for $i from 1 through length($list) {
  43. $item: nth($list, $i);
  44. @if nth($item, 1) == $key {
  45. @return slice($item, 2);
  46. }
  47. }
  48.  
  49. @return $default;
  50. }
  51.  
  52. @function slice($list, $from:0, $to:null) {
  53. $ret: ();
  54.  
  55. @if $to == null {
  56. $to: length($list);
  57. }
  58.  
  59. @for $i from 1 through length($list) {
  60. @if $i >= $from and $i <= $to {
  61. $ret: append($ret, nth($list, $i));
  62. }
  63. }
  64.  
  65. @if length($ret) == 1 {
  66. $ret: nth($ret, 1);
  67. }
  68.  
  69. @return $ret;
  70. }
  71.  
  72. @function farbe($lookup) {
  73. @return lookup($farben, $lookup);
  74. }
  75.  
  76.  
  77. /**************************************************
  78. * mixin
  79. *************************************************/
  80.  
  81. @each $name, $farbe in $themes {
  82. .#{$name}:hover > a,
  83. .#{$name}.active > a,
  84. .#{$name} .level-2 {
  85. color: white;
  86. background-color: $farbe;
  87. }
  88.  
  89. // 2. set the background color of the hovered list element
  90. .#{$name} .level-2 > li:hover,
  91. .#{$name} .level-2 > li.hover,
  92. .#{$name} .level-2 > li.active {
  93. background-color : lighten($farbe, $highlight-amount);
  94. }
  95.  
  96. // 3. Set link-Color to white in second menu level in hover and active states
  97. .#{$name} .level-3 {
  98. background-color : lighten($farbe, $highlight-amount);
  99. }
  100. }
  101.  
  102.  
  103.  
  104.  
  105. %theme-background-color {
  106. background-color: farbe(fallback);
  107. }
  108. %theme-light-background-color {
  109. background-color: lighten(farbe(fallback), $highlight-amount);
  110. }
  111. %theme-border-color {
  112. border-color: farbe(fallback);
  113. }
  114. %theme-color {
  115. color: farbe(fallback);
  116. }
  117. %theme-light-color {
  118. color: lighten(farbe(fallback), $highlight-amount);
  119. }
  120.  
  121.  
  122. @each $name, $farbe in $themes {
  123. .theme-#{$name} %theme-background-color {
  124. background-color: $farbe;
  125. }
  126. .theme-#{$name} %theme-light-background-color {
  127. background-color: lighten($farbe, $highlight-amount);
  128. }
  129. .theme-#{$name} %theme-border-color {
  130. border-color: $farbe;
  131. }
  132. .theme-#{$name} %theme-color {
  133. color: $farbe;
  134. }
  135. .theme-#{$name} %theme-light-color {
  136. color: lighten($farbe, $highlight-amount);
  137. }
  138. .theme-#{$name}-background-color {
  139. background-color: $farbe !important;
  140. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement