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 state styling missing from wp-element-button #49218

Closed
seothemes opened this issue Mar 21, 2023 · 1 comment
Closed

Button state styling missing from wp-element-button #49218

seothemes opened this issue Mar 21, 2023 · 1 comment
Labels
[Block] Buttons Affects the Buttons Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@seothemes
Copy link

Description

When adding button element styles in theme.json, the state styles are not being applied correctly to .wp-button-element. The .wp-block-button__link styles are added correctly:

.wp-element-button, .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
}

The expected CSS should be:

.wp-element-button:hover, .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
}

I have also tested other elements but it appears to only be happening with buttons.

Step-by-step reproduction instructions

  1. Add a button block to a page
  2. View page
  3. Inspect CSS

Screenshots, screen recording, code snippet

Twenty Twenty-Three generated CSS:

screenshot of missing wp-element-button state styles

Twenty Twenty-Three default button styling:

twenty twenty-three default button style

Environment info

  • WordPress 6.1.1, Gutenberg 15.3.1, all themes
  • All browsers
  • All devices

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

@Thelmachido Thelmachido added [Block] Buttons Affects the Buttons Block [Type] Bug An existing feature does not function as intended CSS Styling Related to editor and front end styles, CSS-specific issues. labels Mar 21, 2023
@t-hamano
Copy link
Contributor

@seothemes
Thanks for the report.

This problem is the same as #48901, #48393, #48706 and has been resolved by #48759. #48759 will be part of the next release of the Gutenberg plugin 15.4. Also, since this issue is related to the Gutenberg plugin, it will not occur in WordPress without the Gutenberg plugin enabled.

@t-hamano t-hamano added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Mar 21, 2023
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 CSS Styling Related to editor and front end styles, CSS-specific issues. [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants