Skip to content

Code block: text color settings are overwritten by default style, border on code tag #38007

@luminuu

Description

@luminuu

Description

When using a Code block and trying to set another color for the text, it won't get applied in the editor and on the frontend. I expected to be able to change the text color when using another background color.

Also, the <code> tag itself has a border of 1px solid #ddd. The border color in the settings only applies to the wrapping <pre> tag, not the <code> tag.

Step-by-step reproduction instructions

  1. Open or create a post or page.
  2. Add a Code block to it.
  3. Change the background color to a darker background, so the text becomes unreadable.
  4. Add a border to the block via the settings.
  5. Select a lighter text color for better color contrast.
  6. The text stays in the original dark color, the light border on the code tag is also visible.

Screenshots, screen recording, code snippet

grafik

Environment info

  • WordPress 5.9 RC2
  • no Gutenberg plugin active
  • Twenty Twenty-Two theme, same effect on other themes
  • Browser: Chrome, Firefox
  • OS: macOS Catalina

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

    [Block] CodeAffects the Code Block[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