Picking up from #39336 (comment):
"Flex" attempts to encapsulate all "one-dimensional" layouts in a single type, but I think "one-dimensional" isn't enough to hang a type on conceptually. You see the issues start as soon as you write the justification utility classes. For vertical layout, you need to modify align-items, and for a horizontal layout you need to modify justify-content, and if your classes are human-readable they are basically unable to operate in both contexts. Look at how the buttons block CSS needed to be written1:
.is-layout-flex {
&.is-vertical {
flex-direction: column;
}
&.is-content-justification-left {
justify-content: flex-start;
&.is-vertical {
align-items: flex-start;
}
}
&.is-content-justification-center {
justify-content: center;
&.is-vertical {
align-items: center;
}
}
&.is-content-justification-right {
justify-content: flex-end;
&.is-vertical {
align-items: flex-end;
}
}
&.is-content-justification-space-between {
justify-content: space-between;
}
}
Changing layout behavior based on the presence of .is-vertical is needed at basically every step of the way, because it's an entirely different layout. Everything is much cleaner when you just start with that premise:
.is-layout-stack {
flex-direction: column;
&.is-content-justification-left {
align-items: flex-start;
}
&.is-content-justification-center {
align-items: center;
}
&.is-content-justification-right {
align-items: flex-end;
}
}
.is-layout-row {
flex-direction: row;
&.is-content-justification-left {
justify-content: flex-start;
}
&.is-content-justification-center {
justify-content: center;
}
&.is-content-justification-right {
justify-content: flex-end;
}
&.is-content-justification-space-between {
justify-content: space-between;
}
}
The layout types are conceptually much cleaner when split this way, and the names "stack" and "row" map directly onto the group block variations with the same name.
Picking up from #39336 (comment):
"Flex" attempts to encapsulate all "one-dimensional" layouts in a single type, but I think "one-dimensional" isn't enough to hang a type on conceptually. You see the issues start as soon as you write the justification utility classes. For vertical layout, you need to modify
align-items, and for a horizontal layout you need to modifyjustify-content, and if your classes are human-readable they are basically unable to operate in both contexts. Look at how the buttons block CSS needed to be written1:Changing layout behavior based on the presence of
.is-verticalis needed at basically every step of the way, because it's an entirely different layout. Everything is much cleaner when you just start with that premise:The layout types are conceptually much cleaner when split this way, and the names "stack" and "row" map directly onto the group block variations with the same name.
Footnotes
Lightly modified into a generic "flex" layout for easier comparison. ↩