Created
June 14, 2014 09:56
-
-
Save butchi/facf83184e4d70d82200 to your computer and use it in GitHub Desktop.
Sassのif文で変数の代入 ref: http://qiita.com/butchi_y/items/bc7aae615e7bc3ac7900
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
@each $type in "facebook" "twitter" { | |
.#{$type} { | |
@if $type == "facebook" { | |
$button: "button_like.png"; | |
} @else if $type == "twitter" { | |
$button: "button_tweet.png"; | |
} | |
width: image-width($button); | |
height: image-height($button); | |
background-image: image-url($button); | |
background-repeat: no-repeat; | |
} | |
} |
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
@each $type in "facebook" "twitter" { | |
.#{$type} { | |
$button: ""; | |
@if $type == "facebook" { | |
$button: "button_like.png"; | |
} @else if $type == "twitter" { | |
$button: "button_tweet.png"; | |
} | |
width: image-width($button); | |
height: image-height($button); | |
background-image: image-url($button); | |
background-repeat: no-repeat; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment