Split "flex" layout type into separate "row" and "stack" layout types #44880
Labels
[Feature] Layout
Layout block support, its UI controls, and style output.
[Type] Enhancement
A suggestion for improvement.
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-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: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. ↩
The text was updated successfully, but these errors were encountered: