-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Allow custom style variation classNames #11763
Copy link
Copy link
Open
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Feature] Block Style VariationsIssues or PRs that are related to the style variations for blocksIssues or PRs that are related to the style variations for blocks[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Milestone
Metadata
Metadata
Assignees
Labels
Good First IssueAn issue that's suitable for someone looking to contribute for the first timeAn issue that's suitable for someone looking to contribute for the first time[Feature] Block Style VariationsIssues or PRs that are related to the style variations for blocksIssues or PRs that are related to the style variations for blocks[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
The block styles variations API introduced in #7362 uses an
is-style-{styleName}className to the block for style variants. This works well for core blocks and new blocks, but may be overly opinionated for converting existing content that has an established approach to styling variants (see #7362 (comment)). For example, a pattern library that uses BEM conventions might use.elementfor a default element, and.element.element--variantfor a variant of that element. I'd advocate for a solution that does not require changing an existing naming convention if one exists.Describe the solution you'd like
A
classNameattribute could be added to each style variation which, if supplied, would be used instead of the default generated className. Here's some pseudocode:Describe alternatives you've considered
The only alternative at present is to use the opinionated
is-style-{styleName}naming convention.