Skip to content

Conversation

@GeoffDusome
Copy link
Contributor

What does this do/fix?

Note

This is a migration from the change made on several projects up until this point all having similar issues of specificity between these utility classes and the WP Core selectors for blocks like Heading & Paragraph.

This pull request updates the typography utility classes to make their selectors more specific, ensuring they properly override WordPress core default paragraph and heading styles. This change improves the reliability of custom typography utilities throughout the theme.

Typography utility selector specificity improvements:

  • Updated all typography utility class selectors in wp-content/themes/core/assets/pcss/typography/_utilities.pcss to use :root :where(*):is(.t-*) syntax, increasing specificity and ensuring they override WP core defaults. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Documentation:

  • Added a changelog entry for version 2026.01 describing the increased specificity of typography utility selectors.

QA

Links to relevant issues

@dpellenwood
Copy link
Collaborator

Ooof. This is a really specific selector. I'm hesitant to say this is the best approach here, but understand the complexity of overwriting Core's styles. I'd prefer to get a few other's input on this one before ew commit to it.

@GeoffDusome
Copy link
Contributor Author

Ooof. This is a really specific selector. I'm hesitant to say this is the best approach here, but understand the complexity of overwriting Core's styles. I'd prefer to get a few other's input on this one before ew commit to it.

To be clear, the selectors here are only slightly more specific than what core gives for basic Paragraph blocks (https://p.tri.be/i/k0lQnH) and Heading blocks (https://p.tri.be/i/IiuSUe).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants