Skip to content

Instantly share code, notes, and snippets.

@craigtaub
Last active August 29, 2015 13:57
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 craigtaub/9414837 to your computer and use it in GitHub Desktop.
Save craigtaub/9414837 to your computer and use it in GitHub Desktop.
channel switcher
@mixin channelBackgroundImage($image-name, $has-hover-state: false, $inverted-image: '') {
$base: "../../../img/channels/logos/";
$ext: "_transparent.png";
$image-location: $base + $image-name + $ext;
background-image: url("#{$image-location}");
@if $has-hover-state {
$base: $base + "/hover/";
$image-location: $base + $image-name + $ext;
@include hoverActiveFocus {
background-image: url("#{$image-location}");
}
@if $inverted-image != '' {
$image-location: $base + $inverted-image + $ext;
}
&.current {
background-image: url("#{$image-location}");
}
}
}
====
@mixin channelBackgroundImage($image-name, $has-hover-state: false, $inverted-image: '') {
+ $image-location: "../../../img/channels/logos/" + $image-name;
+ background-image: url("#{$image-location}");
+
+ @if $has-hover-state {
+ $image-location: "../../../img/channels/logos/hover/" + $image-name;
+ @include hoverActiveFocus {
+ background-image: url("#{$image-location}");
+ }
+ @if $inverted-image != '' {
+ $image-location: "../../../img/channels/logos/hover/" + $inverted-image;
+ }
+ &.current {
+ background-image: url("#{$image-location}");
+ }
+ }
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment