Created
October 28, 2013 20:27
-
-
Save ryanahamilton/7204009 to your computer and use it in GitHub Desktop.
SASS Hash as workaround for not being able to interpolate variable names.
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
a { | |
display: block; | |
width: 60px; | |
height: 60px; | |
line-height: 70px; | |
text-align: center; | |
font-size: 30px; | |
color: #fff; | |
@include transition(background-color 0.3s); | |
$media-hash: instagram $instagram-color, pinterest $pinterest-color, google-plus $google-plus-color, tumblr $tumblr-color, feedly $feedly-color; | |
@each $media in $media-hash { | |
$color: nth($media, 2); | |
&.#{nth($media, 1)} { | |
background-color: lighten($color ,20%); | |
&:hover, | |
&:focus { | |
background-color: $color; | |
} | |
} | |
} | |
&.feedly { | |
background: lighten($feedly-color,20%) image-url('sidebar/sprite-connect.png') no-repeat 15px 17px; | |
} | |
}//a |
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
a { | |
display: block; | |
width: 60px; | |
height: 60px; | |
line-height: 70px; | |
text-align: center; | |
font-size: 30px; | |
color: #fff; | |
@include transition(background-color 0.3s); | |
&.instagram { | |
background-color: lighten($instagram-color,20%); | |
&:hover, | |
&:focus { | |
background-color: $instagram-color; | |
} | |
&.pinterest { | |
background-color: lighten($pinterest-color,20%); | |
&:hover, | |
&:focus { | |
background-color: $pinterest-color; | |
} | |
&.google-plus { | |
background-color: lighten($google-plus-color,20%); | |
&:hover, | |
&:focus { | |
background-color: $google-plus-color; | |
} | |
}//&.google-plus | |
&.tumblr { | |
background-color: lighten($tumblr-color,20%); | |
&:hover, | |
&:focus { | |
background-color: $tumblr-color; | |
} | |
}//&.tumblr | |
&.feedly { | |
background: lighten($feedly-color,20%) image-url('sidebar/sprite-connect.png') no-repeat 15px 17px; | |
&:hover, | |
&:focus { | |
background-color: $feedly-color; | |
} | |
}//&.feedly | |
}//a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment