Skip to content

Instantly share code, notes, and snippets.

@mattstauffer
Created March 19, 2014 14:40
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 mattstauffer/9643041 to your computer and use it in GitHub Desktop.
Save mattstauffer/9643041 to your computer and use it in GitHub Desktop.
Sass 3.3 refactor
$weather_bgs: (sun: #ffffcc, rain: #99ccff, snow: #eee, clouds: #ccc);
.weather-bg {
@each $weather_name, $weather_color in $weather_bgs {
&--#{$weather_name} {
background: $weather_color;
}
}
}
.weather-bg--sun {
background: #ffffcc;
}
.weather-bg--rain {
background: #99ccff;
}
.weather-bg--snow {
background: #eee;
}
.weather-bg--clouds {
background: #ccc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment