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

Button Inner Blocks: Allow buttons to inherit styling from existing inner blocks when pressing enter #65496

Open
mikachan opened this issue Sep 19, 2024 · 2 comments
Labels
[Block] Buttons Affects the Buttons Block [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Enhancement A suggestion for improvement.

Comments

@mikachan
Copy link
Member

mikachan commented Sep 19, 2024

What problem does this address?

When a pattern is inserted that includes a Button block with specific styling, any additional buttons that are added when pressing enter after inserting the pattern do not automatically inherit the styling from the pattern. This means the new buttons do not match the intended pattern styling.

For example, when inserting the Heading, Paragraph, Button with Two Images pattern and then adding more buttons next to the existing "Sign up" button, the buttons will not match the pattern styling:

image

(I was using TT4 theme when testing this.)

What is your proposed solution?

Add the ability for an already styled inner block to share its styling with sibling inner blocks easily, ideally automatically. We should still allow users to customise individual inner blocks as usual.

@mikachan mikachan added [Type] Enhancement A suggestion for improvement. [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Block] Buttons Affects the Buttons Block labels Sep 19, 2024
@andrewserong
Copy link
Contributor

Thanks for writing this up!

I think we have this behaviour partially implemented. But only when clicking on the inserter? I remember working on it back in #37905, but it's been so long ago now, looking at that PR it's as if someone else wrote it 😆

In testing in trunk I can see that if I click the inserter, then the styles get copied across as expected. If, however, I press the enter key to create a new button block, the behaviour to copy the block attributes does not apply. As described in this issue, I think it should. Here's how it's looking to me:

2024-09-20.10.49.53.mp4

@mikachan
Copy link
Member Author

In testing in trunk I can see that if I click the inserter, then the styles get copied across as expected.

Ah yes, I can see that's how it's working for me too. So it's only if you press enter to insert a new block. I'll update the issue, thank you!

@mikachan mikachan changed the title Button Inner Blocks: Allow buttons to inherit styling from existing inner blocks Button Inner Blocks: Allow buttons to inherit styling from existing inner blocks when pressing enter Sep 20, 2024
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 [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants