WP 6.6 font styles issue
-
The issue has already been reported regarding links, but the
:root :where(…)
selectors that appeared on WP 6.6 are a huge problem for global font styles.:root :where(body)
has stronger specificity than the regularbody
selector. Same for any tag selector –?p
,h2
,a
…Because of that, the global typographic styles that I declared in my theme are all overrided and it affects every text element on the website, not just blocks.
For example, this will be applied instead of the styles I declared for
h2
in my theme::root :where(h2) {
font-family: var(--wp--preset--font-family--source-serif-pro);
font-size: var(--wp--custom--typography--font-size--lv-2);
font-weight: 700;
line-height: var(--wp--custom--typography--line-height--small);
}As a custom theme designer and developer, this means that I should edit every theme I ever created to replace regular selectors. This is of course highly annoying.
I really don’t understand why this decision was made, and I hope there will be a rollback – or an efficient fix –?on this in a future release.
- You must be logged in to reply to this topic.