New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first-row last-row mixins #9
Comments
Very interesting. I'll take a look at it. Thanks for the suggestion @nirazul! |
I've found a use for that! &:last-child {
border-bottom: 0;
}
@media screen and(min-width: 40.5em) { // 648px
@include my.last-row(2) {
border-bottom: 0;
}
}
@media screen and(min-width: 59.25em) { // 948px
@include my.last-row(3) {
border-bottom: 0;
}
} |
@danielguillan , would you accept a PR? |
I did some tests. Based on this article, we could have something like: ul > li {
@include first(4) { color: red; }
}
ul > li {
@include last(6) { color: blue; }
}
ul > li {
@include last-or-remainder(6) { color: blue; }
} ul > li:nth-child(-n+4) {
color: red;
}
ul > li:nth-child(6n+1):nth-last-child(-n+6) {
color: blue;
}
ul > li:nth-child(6n+1):nth-last-child(-n+6),
ul > li:nth-child(6n+1):nth-last-child(-n+6) ~ li {
color: blue;
} However, in these cases the total quantity doesn't matter, so... I'm not sure these mixins have a place in here. I think they do, but I'm not the boss. |
Don't you want another PR, @danielguillan ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the nice compilation of mixins!
I think it would be a cool addition to also implement first-row and last-row mixins displayed in this article.
I occasionally use this mixin for targeting last rows:
The text was updated successfully, but these errors were encountered: