Created
December 29, 2014 06:56
-
-
Save Gerhut/151caf876c1f84391c10 to your computer and use it in GitHub Desktop.
给属性附加循环列表值
This file contains hidden or 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
| values(property, values) | |
| length = length(values) | |
| for value, index in values | |
| &:nth-child({length}n + {index}) | |
| {unquote(property)} value | |
| /* li | |
| * values(background-color, #8185cd #7cd7c5 #65adeb #ee8e69) | |
| * | |
| * yields | |
| * | |
| * li:nth-child(4n + 0) { | |
| * background-color: #8185cd; | |
| * } | |
| * li:nth-child(4n + 1) { | |
| * background-color: #7cd7c5; | |
| * } | |
| * li:nth-child(4n + 2) { | |
| * background-color: #65adeb; | |
| * } | |
| * li:nth-child(4n + 3) { | |
| * background-color: #ee8e69; | |
| * } | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment