Why do our Stack components not support more flex properties? #11333
Replies: 4 comments 6 replies
-
1 & 2.
Every property we add to
Custom CSS adds to the burden of doing Uplift-like projects: migrating is tricky to automate and custom styles can very quickly conflict with new changes in Polaris as we ship even minor releases. IMO the CSS of Polaris should be considered a private API and never overwritten or relied upon by consumers. But that stance requires a better, more flexible alternative which meets our needs as library maintainers and their needs for flexibility as builders. |
Beta Was this translation helpful? Give feedback.
-
@jesstelford for #1, are you sure we'd want that to add that to Instead, I'd probably rather want to see a |
Beta Was this translation helpful? Give feedback.
-
Initially the thinking was that We have held off adding flex to Stack because we wanted to keep the initial layout components very simple and avoid introducing sub components to manage those flex specific child properties. Seems like we've hit a point where we are seeing need for cases beyond what the initial simple layout components handle, so thank you @sophschneider for getting this discussion going! |
Beta Was this translation helpful? Give feedback.
-
A few more thoughts, When we created that first set of layout primitives they were meant to be small, single purpose components. They were not meant to handle every possible layout case. Based on the usage of those two components, it seems they useful for what they do well. What they don't do well is handle cases that flex would. So I do question whether to extend the stack components, or create a new component to handle the types of things folks are wanting to accomplish with flex. And perhaps having a better understanding of exactly what those things are would also be helpful. |
Beta Was this translation helpful? Give feedback.
-
Gathering context on why we do not support more flex properties in the system.
We used to have a
<LegacyStack.Item fill >
. Now this has to be achieved using css grid via ourInlineGrid
component<InlineGrid columns={{ xs: "1fr auto" }}>
. Some builders have brought up that they still want to use flex instead of grid.Questions to discuss:
LegacyStack
and our currentStack
components have only ever supported a subset of flex properties. What is the historical context for doing this?Box
, extend ourStack
components (would have to support child wrappers), or create a new component?Beta Was this translation helpful? Give feedback.
All reactions