Skip to content

Instantly share code, notes, and snippets.

@Shridhad
Created November 6, 2014 05:34
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 Shridhad/33fbd07bf578edfa53b0 to your computer and use it in GitHub Desktop.
Save Shridhad/33fbd07bf578edfa53b0 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
/* Alias */
$active-tile-background-color: #4C9CEA;
$inactive-tile-background-color: #FFF;
$active-text-color: #FFF;
$inactive-text-color: #000;
/* Lists */
$states: (active, inactive);
$tile-types: (business, home);
%active-text-color {
color: #FFF;
}
%active-bg-color {
background-color: #4C9CEA
}
%inactive-text-color {
color: #000;
}
%inactive-bg-color {
background-color: #FFF
}
.tile{
@each $state in $states{
&.tile--#{$state}{
@extend %#{$state}-text-color;
@extend %#{$state}-bg-color;
.tile__image{
@extend %#{$state}-bg-color;
@each $tile-type in $tile-types{
&.tile--#{$tile-type}{
background-image: image-url("tile/#{$tile-type}-#{$state}.svg")
}
}
}
}
}
}
/* Alias */
/* Lists */
.tile.tile--active {
color: #FFF;
}
.tile.tile--active, .tile.tile--active .tile__image {
background-color: #4C9CEA;
}
.tile.tile--inactive {
color: #000;
}
.tile.tile--inactive, .tile.tile--inactive .tile__image {
background-color: #FFF;
}
.tile.tile--active .tile__image.tile--business {
background-image: url('/images/tile/business-active.svg');
}
.tile.tile--active .tile__image.tile--home {
background-image: url('/images/tile/home-active.svg');
}
.tile.tile--inactive .tile__image.tile--business {
background-image: url('/images/tile/business-inactive.svg');
}
.tile.tile--inactive .tile__image.tile--home {
background-image: url('/images/tile/home-inactive.svg');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment