Skip to content

Color contrast failure when core pattern is placed #46

Open

Description

@carolinan

As part of the accessibility-ready testing, 'sufficient color contrast of text and UI controls', we need to test the theme with the patterns that are added by WordPress core.

https://wpaccessibility.org/docs/accessibility-ready/theme-guidelines/sufficient-color-contrast/

The pattern "Large title", with the technical pattern name core/query-large-title-posts has black text on black background:

screenshot of the pattern placed in the block editor.

The expected result is for the post title to be readable.

To reproduce, open the pattern inserter and insert the "Large title". pattern. It is the fifth pattern if you choose the "All" category.

This pattern does not output a unique identifier on the front of the website, so we cannot solve it with CSS, but we should be able do unregister it.
https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/#unregister_block_pattern

Activity

  1. added
    bug
    on Sep 17, 2026
  2. henriqueiamarino commented on Sep 21, 2026

    @henriqueiamarino
    Contributor

    Thanks for this, @yusuf-saif—great first PR, and welcome!

    I dug into why the pattern breaks: its white link color uses a legacy serialization ("color":{"link":"#ffffff"}) that current WordPress silently ignores, so the titles’ links fall back to the theme’s near-black link color on the black ground. That’s really a core bug in the bundled pattern—worth reporting upstream if someone wants to pick it up.

    I believe there is a nicer fix than removing the pattern: unregister core’s copy and re-register the same slug with the color attributes stripped. Without hardcoded colors, the pattern inherits each style variation’s ground and ink, with readable links everywhere. Would you like to update the PR in that direction? Parse the blocks and unset style.color rather than regex, keep core's title/description/categories on re-registration, and fall back to a plain unregister if the transformed content still contains a hardcoded color.

    On the black/white palette additions: @carolinan is right, and I verified it on a running site—core outputs the default palette's variables and class rules on every page even with defaultPalette off, so those presets already resolve in Ipsum. Please drop that part either way; I'd like to keep the palettes at their six roles.

  3. added
    [Type] Bug
    [Focus] Accessibility (a11y)
    and removed
    bug
    on Oct 2, 2026
  4. rvpatel commented on Oct 22, 2026

    @rvpatel

    This was fixed upstream in core: r64579 (#66201, 19 Oct) moved the Post Title link colour in core/query-large-title-posts from the legacy style.color.link to style.elements.link.color.text, which is the cause @henriqueiamarino identified.

    Verified on WordPress 7.2-beta1 with Ipsum trunk: the "Large title" pattern now shows white titles on the black background, both on the front end and in the block editor, with and without Gutenberg 24.2 active.

    Front end Editor
    Image Image

    Since the fix is only in 7.2, the theme-side workaround is still needed only if Ipsum keeps supporting 7.1. Once #160 (Require WordPress 7.2) is merged, this issue can probably be closed without a theme change.

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

    [Focus] Accessibility (a11y)[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions