Skip to content

Instantly share code, notes, and snippets.

@Demwunz
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Demwunz/9048127 to your computer and use it in GitHub Desktop.
Save Demwunz/9048127 to your computer and use it in GitHub Desktop.
scss_each_loop.scss
/*
* a way to save time when you want to output a bunch of class names with corresponding filenames
*/
$icons: sprite-map("icons/*.png");
.select-custom--icons{
background-image: sprite-url($icons);
background-color:white;
background-repeat: no-repeat;
}
$languages : (en, zh-cn, ja, it, pt, es, de);
@each $language in $languages {
$i: index($languages, $language);
.select-flag--#{$language}{
background-position: sprite-position($icons, $language);
z-index: $i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment