Created
August 26, 2017 05:10
-
-
Save alexdiliberto/ba4a4369c03392934146b5d53ed8973c to your computer and use it in GitHub Desktop.
matches the last item only if the list has exactly N items
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
/* | |
matches the last item only if the list has exactly N items | |
e.g. for N = 3: | |
*/ | |
$N: 3; | |
:nth-last-child(-n+#{$N}):first-child ~ li:nth-child(#{$N}) { | |
color: red; | |
} | |
/* compiles to :nth-last-child(-n+3):first-child ~ li:nth-child(3) */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment