Skip to content

Instantly share code, notes, and snippets.

@rpearce
Created April 27, 2012 07:30
Show Gist options
  • Save rpearce/2506941 to your computer and use it in GitHub Desktop.
Save rpearce/2506941 to your computer and use it in GitHub Desktop.
SASS interpolation, list, mixin, and @each
// List
$box-shadow-properties: -webkit-box-shadow, -moz-box-shadow, box-shadow;
// Mixin waiting to be included
@mixin box-shadow-with-inset($box-shadow-params, $inset-params) {
// Iterates over each element in the list
@each $property in $box-shadow-properties {
// Uses interpolation to have the compiler then list out the properties listed above
#{$property}: $box-shadow-params, $inset-params; }
}
.logobar-inner {
@include box-shadow-with-inset(0px 1px 3px rgba(0, 0, 0, 0.25), inset 0px -1px 0px rgba(0, 0, 0, 0.1));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment