Created
November 9, 2020 14:08
-
-
Save jsakhil/83719a5382840cf6c535495d76bd138d to your computer and use it in GitHub Desktop.
Color loop in Scss
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
$colors: ("blue", #0000ff, "green", #008000, "orange", #fca644); | |
@for $index from 1 through length($colors){ | |
div:nth-child(#{length($colors)}n + #{$index}) { | |
color: unquote(nth($colors, $index)); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment