Skip to content

Instantly share code, notes, and snippets.

@magicspon
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magicspon/546e00098cdc15a41db2 to your computer and use it in GitHub Desktop.
Save magicspon/546e00098cdc15a41db2 to your computer and use it in GitHub Desktop.
Pointless SCSS Number 1
// totally pointless mixin..
// save yourself from typing two characters
// when applying the same values to different properties
// think of all the things you can do with the time saved
// @include s((border-left,border-right), 1px solid red); == 54 chars
// border-left: 1px solid red; border-right: 1px solid red; == 56 chars
// that's right... totally pointless mixin
@mixin s($props: (s, i, a, l), $val: false){
@for $i from 1 through length($props) {
$prop: nth($props, $i);
#{$prop}: $val;
}
}
.test {
@include s((border-left,border-right), 1px solid red);
}
.test {
border-left: 1px solid red;
border-right: 1px solid red; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment