Created
May 28, 2015 17:47
-
-
Save teles/01abe3b0158a3600cd24 to your computer and use it in GitHub Desktop.
Background stripes mixin source code.
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
@mixin background-stripes($stripes-colors...) { | |
$stripes-list: (); | |
@for $i from 1 through length($stripes-colors){ | |
$stripe-number-prev: #{100%/length($stripes-colors) * ($i - 1)}; | |
$stripe-number: #{100%/length($stripes-colors) * $i}; | |
$stripe-color: nth($stripes-colors, $i); | |
$stripe-declaration-prev: $stripe-color $stripe-number-prev; | |
$stripe-declaration: $stripe-color $stripe-number; | |
$stripes-list: append($stripes-list, $stripe-declaration-prev, comma); | |
$stripes-list: append($stripes-list, $stripe-declaration, comma); | |
} | |
background-image: linear-gradient(to right, $stripes-list); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment