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

Add support for variation styling #98

Open
g-elwell opened this issue Aug 22, 2024 · 0 comments
Open

Add support for variation styling #98

g-elwell opened this issue Aug 22, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@g-elwell
Copy link
Member

What problem does this address?

It's possible within theme.json to add styling specific to block variations, users should be able to do this via the UI as well. See: https://developer.wordpress.org/news/2023/05/26/customizing-core-block-style-variations-via-theme-json/

Note, this currently only applies to core block variations. There is an open issue for extending this to custom variations.

With this limitation in place, the functionality may be limited. I'm also interested in what might be the most common use-case for this, styling outline button states.

Since the variation styles would be applied at the block level, not element level, it may not be possible to use the variation capability to style outline button hover/active states.

What is your proposed solution?

Extend the UI to include variations as a nested option within blocks. So rather than expanding a block and seeing elements listed individually, you would see elements and variations, which can each be expanded to show the available options within them. Eg:

Button
-- Elements
---- Link
---- H1
-- Style Variations
---- Outline

It looks as though the theme.json schema supports both elements and blocks nested within variations. Elements makes sense but I am wondering whether blocks being there is an error, as you can't style nested blocks in other contexts.

@g-elwell g-elwell added the enhancement New feature or request label Aug 22, 2024
@jonnywatersbb jonnywatersbb added this to the v1.1.0 milestone Aug 30, 2024
@chrishall0 chrishall0 self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants