You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate buttons & navigation to flex layout #34872
I've noticed that the buttons block and the navigation block both use the same "justification" options in the toolbar that are serialized to the post using the justification-content property.
Via the layout support we've developed a flex layout that already takes care of this for blocks.
This is to track that we need to migrate those blocks to the new layout support.
Hi @oandregal It makes sense to have this automatically applied but I don't think it's a separate or new block support. In a recent refactor to the social icons block @ntsekouras did, this control has been added to the "Flex Layout", in other words, any block that declares itself as a "flex layout container" will get this automatically. Do you think this address these use-cases?
👋 - fun fact I was planning to start today the QueryPagination to use flex layout and will have the justification controls from the layout. Also thanks for pointing the issue!
For me the justification controls should be handled by layout and I have in plans to explore that for such blocks like Buttons. In my mind we should deprecate the orientation prop in these blocks.
Ah, lovely. So, does that mean that buttons and navigation should be migrated to use the block supports instead ( __experimentalLayout.default.type.flex)? I see they manage this themselves in the edit function.
Those are the typical things a block supports does automatically. As far as I understand, that's how social links do it: by using the existing __experimentalLayout.default.type.flex block support. Is that correct? It seems intuitive to me that buttons and navigation would do the same.
Another question I have is: how this can be exposed in the theme.json for theme authors and what options do theme authors need? This is in the context of this other #34784 (comment) in which @getdave wanted to control justification options from the theme.json.
Yes ideally, all of Buttons, Navigation and Columns maybe as well should be refactored to use the "flex" layout and they'll inherit the controls automatically.
Another question I have is: how this can be exposed in the theme.json for theme authors and what options do theme authors need? This is in the context of this other #34784 (comment) in which @getdave wanted to control justification options from the theme.json.
I think allowing layout changes in theme.json is probably something we need to work on at some point but it's not straightforward, it's a bit more complex that the current simple styles we have. (Also, how to reflect these default values automatically in the UI without the block having the said attribute)
Activity
oandregal commentedon Sep 16, 2021
There's also some interest to get this in other blocks, such as #32680
oandregal commentedon Sep 16, 2021
JFYI @aaronrobertshaw @ramonjd @ntsekouras @youknowriad
[-]Block supports: add justification[/-][+]Add justification as a new block support[/+]youknowriad commentedon Sep 16, 2021
Hi @oandregal It makes sense to have this automatically applied but I don't think it's a separate or new block support. In a recent refactor to the social icons block @ntsekouras did, this control has been added to the "Flex Layout", in other words, any block that declares itself as a "flex layout container" will get this automatically. Do you think this address these use-cases?
ntsekouras commentedon Sep 16, 2021
👋 - fun fact I was planning to start today the
QueryPaginationto useflexlayout and will have thejustificationcontrols from the layout. Also thanks for pointing the issue!For me the justification controls should be handled by layout and I have in plans to explore that for such blocks like
Buttons. In my mind we should deprecate theorientationprop in these blocks.oandregal commentedon Sep 16, 2021
Ah, lovely. So, does that mean that buttons and navigation should be migrated to use the block supports instead (
__experimentalLayout.default.type.flex)? I see they manage this themselves in the edit function.ntsekouras commentedon Sep 16, 2021
No, I don't think so.. I think we should make them work with
layoutWhat do you mean? They now use
orientationfor this, no?oandregal commentedon Sep 16, 2021
This is what I see:
contentJustification+orientation), serialize the classes itself, and add the UI control.orientationanditemsJustification), serialize the classes, and add the UI controls.Those are the typical things a block supports does automatically. As far as I understand, that's how social links do it: by using the existing
__experimentalLayout.default.type.flexblock support. Is that correct? It seems intuitive to me that buttons and navigation would do the same.Another question I have is: how this can be exposed in the
theme.jsonfor theme authors and what options do theme authors need? This is in the context of this other #34784 (comment) in which @getdave wanted to control justification options from thetheme.json.youknowriad commentedon Sep 16, 2021
Yes ideally, all of Buttons, Navigation and Columns maybe as well should be refactored to use the "flex" layout and they'll inherit the controls automatically.
I think allowing layout changes in theme.json is probably something we need to work on at some point but it's not straightforward, it's a bit more complex that the current simple styles we have. (Also, how to reflect these default values automatically in the UI without the block having the said attribute)
[-]Add justification as a new block support[/-][+]Migrate buttons & navigation to flex layout[/+]oandregal commentedon Sep 16, 2021
OK. Updated title and description to better reflect the conversation.