Last active
December 11, 2015 11:09
-
-
Save blackfalcon/4591925 to your computer and use it in GitHub Desktop.
Remove repetitive code from your life. The problem I needed to solve was that I was writing too many lines of code that was the exact same pattern. This is where Sass shows real strength.
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
// Sass v3.2.5 | |
// Stipe v0.0.5.5 | |
// @import "stipe/manifest"; | |
$color_names: shadow_color href_color form_field_border; | |
$color_var: $shadow_color $href_color $form_field_border; | |
@each $name in $color_names { | |
$i: index($color_names, $name); | |
%#{$name} { | |
background: nth($color_var, $i); | |
} | |
} | |
@each $name in $color_names { | |
$i: index($color_names, $name); | |
.#{$name} { | |
background: nth($color_var, $i); | |
} | |
} |
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
.shadow_color { | |
background: rgba(51, 51, 51, 0.5); | |
} | |
.href_color { | |
background: #a45454; | |
} | |
.form_field_border { | |
background: #5c5c5c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment