Last active
August 29, 2015 13:57
-
-
Save craigtaub/9414837 to your computer and use it in GitHub Desktop.
channel switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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