Family.scss is a set of smart Sass mixins which will help you to manage the style of :nth-child
'ified elements, in an easy and classy way.
The goal of this project is to unleash the power of the nth-child property, in an easy way
The better way to understand each and every mixin, is to read it, literally.
for example : first(3) => first three
Each and every mixin is really easy to use, proceed like this :
ul li {
background: blue;
@include first(3) {
background: red
}
}
ul li {
background: blue;
}
ul li:nth-child(-n + 3) {
color: red;
}
@include first(3)
@include last(3)
@include after-first(5)
@include from-end(3)
@include between(3, 6)
@include pair-between(3, 12)
@include impair-between(3, 13)
@include all-but(3)
@include each(3)
// Alias of each()
@include every(3)
@include from-first-last(2)
@include middle(11)
@include all-but-first-last(2)
@include first-of(10)
@include last-of(10)
@include pair()
// Alias of pair()
@include even()
@include impair()
// Alias of impair()
@include odd()
@include first-last()
@include unique()
@include not-unique()
Apply an ordered z-index
over each child.
// Basic usage
@include child-index(10); // equivalent of @include child-index(10, forward, 0)
// This mixin can take up to 3 arguments :
// $num : Number of child to index
// $direction : Direction of the indexing [ forward / backward ]
// $index : Base indexing number [1, 10, 20 => 1, 2, 3; 11, 12, 13; 21, 22, 23 ]
@include child-index(5, backward, 10);