SASS using & for parent and that parent is first-child -
i know can specify if element has specific parent using &
:
.btn { .btn-group & { color: blue; } }
but can if parent btn-group , .btn-group first child?
something like:
.btn { .btn-group & &:first-child { color: blue; } }
but doesn't seem work.
i worked out can do:
.btn { .btn-group:first-child & { color: blue; } }
but couldn't find way have multiple pseudo selectors (except using above syntax comma separated):
// doesn't work :( .btn { .btn-group & { &:first-child, &:last-child { color: blue; } } }
Comments
Post a Comment