Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate buttons & navigation to flex layout #34872

Closed
1 of 2 tasks
Tracked by #35521
oandregal opened this issue Sep 16, 2021 · 9 comments · Fixed by #36169
Closed
1 of 2 tasks
Tracked by #35521

Migrate buttons & navigation to flex layout #34872

oandregal opened this issue Sep 16, 2021 · 9 comments · Fixed by #36169
Assignees
Labels
[Block] Buttons Affects the Buttons Block [Block] Navigation Affects the Navigation Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress

Comments

@oandregal
Copy link
Member

oandregal commented Sep 16, 2021

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.

  • buttons
  • navigation
@oandregal
Copy link
Member Author

There's also some interest to get this in other blocks, such as #32680

@oandregal
Copy link
Member Author

JFYI @aaronrobertshaw @ramonjd @ntsekouras @youknowriad

@oandregal oandregal added [Block] Buttons Affects the Buttons Block [Block] Navigation Affects the Navigation Block [Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Sep 16, 2021
@oandregal oandregal changed the title Block supports: add justification Add justification as a new block support Sep 16, 2021
@youknowriad
Copy link
Contributor

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
Copy link
Contributor

ntsekouras commented Sep 16, 2021

👋 - 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.

@oandregal
Copy link
Member Author

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
Copy link
Contributor

So, does that mean that buttons and navigation should be migrated to use the block supports instead

No, I don't think so.. I think we should make them work with layout

I see they manage this themselves in the edit function.

What do you mean? They now use orientation for this, no?

@oandregal
Copy link
Member Author

This is what I see:

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.

@youknowriad
Copy link
Contributor

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)

@oandregal oandregal changed the title Add justification as a new block support Migrate buttons & navigation to flex layout Sep 16, 2021
@oandregal
Copy link
Member Author

OK. Updated title and description to better reflect the conversation.

@ntsekouras ntsekouras removed the [Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block label Sep 16, 2021
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Block] Navigation Affects the Navigation Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants