Created
May 22, 2014 10:15
-
-
Save tobystokes/20cdae640b7a59f998ec to your computer and use it in GitHub Desktop.
SASS target languages mixin
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
// select by language, send it one or more comma separated quote-delimited locale codes | |
// assuming lang attribute is set on the html tag, like it should be! | |
// usage: @include if-lang("de") {} | |
// usage: @include if-lang("de", "en", "cn-ZH") {} | |
@mixin if-lang($locales...) { | |
@for $i from 1 through length($locales) { | |
html[lang=#{nth($locales, $i)}] & { | |
@content; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment