-
Notifications
You must be signed in to change notification settings - Fork 757
Closed
Labels
Description
referencing: https://www.w3.org/TR/selectors-4/
proposed pseudo-classes: :first-wrap, :last-wrap, :first-wrap-row, :last-wrap-row, :nth-wrap-row()
The idea is to have pseudo-classes to help style wrapped flex items.
Given this HTML:
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
<li>four</li>
<li>five</li>
<li>six</li>
<li>seven</li>
<li>eight</li>
<li>nine</li>
</ul>and this CSS:
ul {
display: flex;
flex-wrap: wrap;
}
ul > * + * {
border-left: 2px solid black;
}
li {
width: 150px;
}The possibility to style first (or last) wrapped elements with a pseudo-class:
ul:first-wrap {
border: none;
} output 1:

output 2 (window resize):

The possibility to style entire flex rows:
ul:first-wrap-row > * {
border-bottom: 2px solid black;
}:last-wrap, :last-wrap-row, and :nth-wrap-row() are self-explanatory.
mbledkowski, codesource, TheWeirdDev, abel-eero, sergio-cravas and 1 more


