Skip to content

Instantly share code, notes, and snippets.

@smileyj68
Created February 19, 2015 18:22
Show Gist options
  • Save smileyj68/cadceb4b86d5aa3e93e3 to your computer and use it in GitHub Desktop.
Save smileyj68/cadceb4b86d5aa3e93e3 to your computer and use it in GitHub Desktop.
Tabcordion SCSS Nth Child
@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