Color palette as CSS variables logs wp.components.Theme warnings in the Site Editor
还没有人认领这个 Issue。
评估
调研方向
Start by reading the settings.color.palette entries in theme.json and note which ones are var(--nv-…, #hex) values (ti-bg, ti-fg, and the rest). Then find where Assets_Manager prints the inherited inline CSS so the --wp--preset--color--ti-* overrides can move there. Done looks like literal hex values in the palette, Neve-migrated sites still showing Neve's colours, and no wp.components.Theme warnings in the Site Editor console with SCRIPT_DEBUG on.
由索引模型根据 Issue 内容生成。
描述
Description
The theme's colour palette is defined as CSS variables, which the Site Editor's own colour handling can't read. Every time the Site Editor opens, the browser console shows three warnings:
wp.components.Theme: "var(--nv-text-color, #202020)" is not a valid color value for the 'accent' prop.
wp.components.Theme: "var(--nv-site-bg, #FFFFFF)" is not a valid color value for the 'background' prop.
wp.components.Theme: The background color ("var(--nv-site-bg, #FFFFFF)") does not have sufficient contrast against the accent color ("var(--nv-text-color, #202020)").
Every entry of theme.json settings.color.palette is a var(--nv-…, #hex) value, so that a site coming from Neve inherits Neve's colours (ti-bg is var(--nv-site-bg, #FFFFFF), ti-fg is var(--nv-text-color, #202020), and so on). The Site Editor passes the palette's background and foreground to wp.components.Theme, which expects literal colours. So it can't compute the canvas UI's colours or the contrast check from them.
Step-by-step reproduction instructions
- With Eduacademy 1.0.1 active and
SCRIPT_DEBUGon, go to Appearance → Editor. - Open the browser console.
Expected: no warnings from the theme's palette.
Actual: the three wp.components.Theme warnings above, on every Site Editor load, and on every template or part opened in it.
Screenshots, screen recording, code snippet or Help Scout ticket
Possible fix: keep literal hex values in theme.json's palette, and apply the Neve overrides through the inherited inline CSS that Assets_Manager already prints (overriding the --wp--preset--color--ti-* variables there). The palette entries would then be real colours, while a site coming from Neve still gets Neve's colours.
Found while adding Eduacademy to the WordPress compatibility checks (Codeinwp/qa-compatibility#168). Seen on WordPress 7.0.9, 7.1-RC1 and 7.1.5 alike.
Environment info
Eduacademy 1.0.1 (built from the v1.0.1 tag), WordPress 7.0.9 / 7.1-RC1 / 7.1.5, PHP 8.3, SCRIPT_DEBUG on, Chromium.
Is the issue you are reporting a regression
No
- 主要语言
- PHP
- 星标
- 0
- 派生
- 0
- 平均合并
- 22 小时 12 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Codeinwp/eduacademy 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 84/100
Codeinwp/eduacademy#30 ·
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
Codeinwp/eduacademy#31 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Codeinwp/eduacademy#29 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
Codeinwp/eduacademy#28 ·
-
难度 3/5 1-2 天 新手友好度 35/100
Codeinwp/eduacademy#6 ·
查看 Codeinwp/eduacademy 的全部 Issue
相似的 Issue
-
Change: check an identifier filter the same way in every tool - the order of somcp_search_orders未关闭consistency enhancement Orders
难度 1/5 1 小时以内 新手友好度 88/100
novalo-dev/Prestashop-MCP-Server#343 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
claude
难度 2/5 1-3 小时 新手友好度 72/100
sprain/sprainocchio#45 ·
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复