Skip to content

Global Styles: Button element should inherit all typography styles on the frontend #60403

@t-hamano

Description

@t-hamano

Description

Found in this comment

Button elements, i.e. elements with the wp-element-button class, inherit some typography styles by default. However, I realized that we are missing some styles that we should inherit:

  • font-style
  • text-transform
  • letter-spacing
  • font-weight

For example, update all typography styles at the root level via the Global Styles and insert a Search block.

image

Expected (Editor)

If you're using Emptytheme, you'll see something like this in the editor, which is what you'd expect. This is because the button is a div element.

image

Not Expected (Frontend)

On the front end, you can see that the following styles are not applied to the button.

  • font-style
  • text-transform
  • letter-spacing
  • font-weight

image

Step-by-step reproduction instructions

  • Activate Emptytheme: Testing will be a little more difficult in TT4 as the button element's default style is overridden.
  • Go to the Site Editor > Global Styles > Typography > Text > Typography panel
  • Update all styles.
  • Insert a Search block in a post and see how it looks on the front end.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] TypographyFont and typography-related issues and PRs[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions