Add individual css class to default block variations (by default) #54658
Labels
[Feature] Block Style Variations
Issues or PRs that are related to the style variations for blocks
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Enhancement
A suggestion for improvement.
When blocks have style variations, the default should have a corresponding css class.
Use case:
I want to add a text-shadow to my default button (but only this one).
I cannot do it via theme.json
"css": "text-shadow…"
because this adds it also to the outline and other custom variations. At the moment it's not possible to use"css":…
in variations to remove this css then again.Therefore, I must enqueue a css file.
However, I cannot only target the default button, because it does not have by default an individual css class. Only after I have clicked on the style variation "default" the css class
is-style-fill
is added. (By the way, it could make sense to rename this to default, instead of fill)There is probably somewhere a discussion around this already, but I couldn't find it. If anyone knows where it was, it'd love to know the reason why this isn't implemented yet.
The text was updated successfully, but these errors were encountered: