Description
Family.scss is a Sass library of 26 mixins for styling elements by their position among their siblings. Instead of writing :nth-child selectors by hand, you call a named mixin and Sass generates the rule. first(3) covers the first three items, between(3, 6) covers items three to six, and the other mixins handle last items, items after the first, counts from the end, even and odd ranges, all-but cases and each nth item. The documentation shows the result of every mixin next to a list of numbered items, so you can see the effect before using it. The library is a small download of about 4 KB, and its source and releases are public on GitHub. It is for front-end developers who write their styles in Sass and want short, readable selectors for list items and similar repeated elements.…
Highlights
- 26 Sass mixins for styling :nth-child items
- Named mixins such as first(3) and between(3, 6)
- Covers even, odd and counted-from-end positions
- About 4 KB download
- Public source code and releases on GitHub
Ratings & Reviews
No ratings yet
Be the first to rate Family.scss.
People also visit

scss-best-practices
SCSS/Sassy CSS best practices and coding guidelines for maintainable
Family.scss FAQ
What is Family.scss?
A Sass library of 26 mixins that style elements by their position among siblings. You call a mixin such as first(3) and it writes the matching :nth-child rule for you.
How do I use a mixin?
Include it inside a selector, for example ul li { @include first(3) { background: red; } }. The arguments set the range, such as between(3, 6) for items three to six.
How do I get it?
Download the roughly 4 KB file from the project site, or get the source and releases from its GitHub repository.
Which positions can I target?
The documentation lists first, last, after-first, from-end, between, even-between, odd-between, n-between, all-but, each, from-first-last, middle and all-but-first-last, plus first-of and last-of.
Is Family.scss open source?
The source code is public on GitHub. The page does not state a license, so check the repository before reusing the code.
What are the best Family.scss alternatives?
Popular alternatives to Family.scss include Sass, bennettfeely.com/clippy and missing.css. See all Family.scss alternatives






.gif?auto=compress&fit=max&w=128)




