-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Wrong CSS Styles when defining custom Button fontSizes #56015
Copy link
Copy link
Closed
Labels
CSS StylingRelated to editor and front end styles, CSS-specific issues.Related to editor and front end styles, CSS-specific issues.Needs TestingNeeds further testing to be confirmed.Needs further testing to be confirmed.[Block] ButtonsAffects the Buttons BlockAffects the Buttons Block[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.Gives the original author opportunity to update before closing. Can be reopened as needed.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Metadata
Metadata
Assignees
Labels
CSS StylingRelated to editor and front end styles, CSS-specific issues.Related to editor and front end styles, CSS-specific issues.Needs TestingNeeds further testing to be confirmed.Needs further testing to be confirmed.[Block] ButtonsAffects the Buttons BlockAffects the Buttons Block[Status] StaleGives the original author opportunity to update before closing. Can be reopened as needed.Gives the original author opportunity to update before closing. Can be reopened as needed.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
When defining custom fontSizes for the core/button it puts the correct class but the style that is generated has the class in the wrong element.
Theme.json:
Produced markup in the editor:
Produced markup in the front end:
Produced Style for has-button-xlarge-font-size in the editor:
Produced Style for has-button-xlarge-font-size in the front end:
As you can see, it does everything it is supposed to, but the styles are supposed to be
wp-block-button.has-button-xlarge-font-size .wp-block-button__linkStep-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
WP 6.4.1 (core gutenberg)
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes