fix: stop the text palette slug from hijacking every custom colour
theme.json shipped a palette entry with the slug "text", so WordPress
generated `.has-text-color { color: var(--wp--preset--color--text)
!important }`. The block editor puts that same class on any block given a
custom text colour, so the rule overrode every one of them site-wide with
the dark-theme foreground, unreadable in either theme. An !important
declaration beats an inline style, which is why the colour set on the
block never had a chance.
Rename the slug to "foreground". No published content used the class, for
the obvious reason that it never worked, so nothing has to be migrated.
A smoke test now rejects any palette slug that shadows an editor utility
class.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
27 files changed
+308
-185
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ html {
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--wp--preset--color--night);
|
||||
color: var(--wp--preset--color--text);
|
||||
color: var(--wp--preset--color--foreground);
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ html[data-theme="light"] header.wp-block-template-part {
|
||||
.chrnx-theme-control > [data-chrnx-theme-button]:hover,
|
||||
.chrnx-theme-control > [data-chrnx-theme-button][aria-expanded="true"] {
|
||||
background: color-mix(in srgb, var(--wp--preset--color--green) 24%, transparent);
|
||||
color: var(--wp--preset--color--text);
|
||||
color: var(--wp--preset--color--foreground);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ html[data-theme="light"] .chrnx-theme-control > [data-chrnx-theme-button][aria-e
|
||||
/* Quiet chip, full-contrast label: accent-on-accent fails WCAG AA. */
|
||||
.chrnx-theme-toggle [data-chrnx-theme-value][aria-pressed="true"] {
|
||||
background: color-mix(in srgb, var(--wp--preset--color--green) 24%, transparent);
|
||||
color: var(--wp--preset--color--text);
|
||||
color: var(--wp--preset--color--foreground);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user