Skip to content

Link color in post content cannot be over-ridden with global styles #53534

Closed as not planned

Description

@mburridge

Description

When the Twenty Twenty-Three theme is activated and you try to change the link color in global styles the color of links does not change in the post content, though they do change in other parts of the template, e.g. footer, comments form, etc...

Interestingly changing the link hover color does work okay.

Step-by-step reproduction instructions

  1. Make Twenty Twenty-Three your active theme
  2. Create a post with links in the post content
  3. Go to global styles -> colors
  4. Change the link color
Screenshot 2023-08-10 at 15 44 45
  1. View the page in the front end
  2. Verify that links still use the Secondary color - #345C00 (though hover color defined in global styles works okay)

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.3
Chrome Version 114.0.5735.106
macOS Monterey

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

Activity

  1. added
    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json
    [Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.
    on Aug 10, 2023
  2. t-hamano commented on Aug 11, 2023

    @t-hamano
    Contributor

    Thanks for the report.

    I think the problem is because Twenty Twenty Three applies text color to the link in the post content block via theme.json.

    https://core.trac.wordpress.org/browser/trunk/src/wp-content/themes/twentytwentythree/theme.json#L329

    In the global style, You should be able to override this style by changing the link color in the post content block.

  3. t-hamano commented on Aug 11, 2023

    @t-hamano
    Contributor

    In the global style, You should be able to override this style by changing the link color in the post content block.

    There was insufficient explanation on this point. Color support for te Post Content block was added in #51326. This will be available in Gutenberg 16.5.

  4. mburridge commented on Aug 11, 2023

    @mburridge
    ContributorAuthor

    Thanks @t-hamano , I couldn't change the link color from the post content block. Thanks for the explanation.

  5. t-hamano commented on Aug 12, 2023

    @t-hamano
    Contributor

    I believe this issue has been resolved and would like to close it, but if I have missed something, please comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Block] Post ContentAffects the Post Content Block[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions