Created
February 19, 2015 18:22
-
-
Save smileyj68/cadceb4b86d5aa3e93e3 to your computer and use it in GitHub Desktop.
Tabcordion SCSS Nth Child
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
@for $i from 1 through 6 { | |
&.small-#{$i}-up { | |
.tab { | |
width: percentage(1 / $i); | |
} | |
&>.tab, &>.tab-content, &>input { | |
@if $i == 2 { | |
&:nth-child(-n+30) { order: 5; | |
&:checked + label + .tab-content { order: 6; } | |
} | |
&:nth-child(-n+24) { order: 4; | |
&:checked + label + .tab-content { order: 5; } | |
} | |
&:nth-child(-n+18) { order: 3; | |
&:checked + label + .tab-content { order: 4; } | |
} | |
&:nth-child(-n+12) { order: 2; | |
&:checked + label + .tab-content { order: 3; } | |
} | |
&:nth-child(-n+6) { order: 1; | |
&:checked + label + .tab-content { order: 2; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment