Skip to content

Instantly share code, notes, and snippets.

@gbhasha
Created November 6, 2014 05:43
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 gbhasha/cb2b3ca40b451777c2bd to your computer and use it in GitHub Desktop.
Save gbhasha/cb2b3ca40b451777c2bd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
// Alias
// ------
$config__tile: (
"active": (
"background-color": #4C9CEA,
"text-color": #FFF
),
"inactive": (
"background-color": #FFF,
"text-color": #000
)
);
// Lists
// -----
$states: active inactive;
$tile-types: business home;
@each $state in $states {
.tile--#{$state} {
color: map-get(map-get($config__tile, $state), "text-color");
background-color: map-get(map-get($config__tile, $state), "background-color");
.tile__image {
@each $tile-type in $tile-types {
&.tile--#{$tile-type} {
background-image: image-url("tile/#{$tile-type}-#{$state}.svg")
}
}
}
}
}
.tile--active {
color: #FFF;
background-color: #4C9CEA;
}
.tile--active .tile__image.tile--business {
background-image: url('/images/tile/business-active.svg');
}
.tile--active .tile__image.tile--home {
background-image: url('/images/tile/home-active.svg');
}
.tile--inactive {
color: #000;
background-color: #FFF;
}
.tile--inactive .tile__image.tile--business {
background-image: url('/images/tile/business-inactive.svg');
}
.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