Skip to content

Instantly share code, notes, and snippets.

@atleb
Created September 19, 2014 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atleb/8534da214dd5272ac35b to your computer and use it in GitHub Desktop.
Save atleb/8534da214dd5272ac35b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
@function map-fetch($map, $keys) {
$key: nth($keys, 1);
$length: length($keys);
$value: map-get($map, $key);
@if ($length > 1) {
$rest: ();
@for $i from 2 through $length {
$rest: append($rest, nth($keys, $i))
}
@return map-fetch($value, $rest)
} @else {
@if ($value){ @return $value;}
@else { @return map-get($default, $key) }
}
}
$default: (
colorTitle: #fff
);
$config: (
themes: (
Default: (
colorMain: #fff
),
Meninger: (
colorMain: none,
colorTitle: #2e87a7
),
Sport: (
colorMain: none
)
)
);
@mixin containerTheme($headerBgColor, $headerTextColor: #fff ){
& {
.df-container-header {
color: $headerTextColor;
}
}
}
@each $theme in map-keys(map-get($config, themes)) {
df-skin-row-#{$theme} {
@include containerTheme(
map-fetch($config, themes $theme colorMain),
map-fetch($config, themes $theme colorTitle)
);
}
}
df-skin-row-Default .df-container-header {
color: #fff;
}
df-skin-row-Meninger .df-container-header {
color: #2e87a7;
}
df-skin-row-Sport .df-container-header {
color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment