Closed
Description
It would be nice to have an nth-child selector that respects order of the elements changed with an order
property. It could be named like nth-order
or nth-by-order
.
Usage example:
<div class="container">
<div class="element first">1</div>
<div class="element second">2</div>
<div class="element third">3</div>
</div>
.container
{
display: flex;
flex-direction: column;
}
.element.third
{
order: -1; /* Now it's the first element */
}
.element:not(:nth-last-order)
{
margin-bottom: 20px; /* Actual last element doesn't have margin */
}