Open shimotmk opened 2 months ago
Confirmed, I can also reproduce this.
It looks like the block styles apply to the button wrapper wp-block-button
, whereas the element styles apply to the inner element wp-element-button
and that's why they take precedence.
I tested 6.5, and it was the same in that version, so it doesn't seem to be a new bug.
@talldan hit the nail on the head.
Global styles for the button block type will also target the inner element. The button block seems to have some ad hoc styles to force inheritance but they don't seem to cover all typography styles.
For example:
.wp-block-button[style*=font-weight] .wp-block-button__link {
font-weight: inherit;
}
There might be two options for a fix;
Option 1 might be the simplest but would need to be updated for any new typography supports added in the future.
Description
If typography is set for the button element in theme.json, the settings in the block will not work.
Step-by-step reproduction instructions
You can see that the Appearance has not changed in either the editor screen or the front screen.
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.