Editor: Restore contrast of active TinyMCE toolbar button icons - #12783
Editor: Restore contrast of active TinyMCE toolbar button icons#12783itzmekhokan wants to merge 1 commit into
Conversation
TinyMCE's lightgray skin styles active toolbar buttons as white icons on a dark background, and this file overrides both halves of that: the background becomes light gray, and the icon colour reverts to `inherit`. The colour override used the same selectors as the skin, so it only won the cascade when it was parsed later. TinyMCE appends its skin stylesheet when the editor initializes. When the editor is initialized after page load, as the Classic block does, the skin is parsed after this file and its white icon colour wins, leaving the icons all but invisible on the light gray background. Add the `mce-widget` class, which TinyMCE puts on every button alongside `mce-btn`, to the override so it wins on specificity instead of source order. Fixes #65768.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
TinyMCE's lightgray skin styles active toolbar buttons as white icons on a dark background.
editor.cssoverrides both halves — the background becomes light gray and the icon colour reverts toinherit— but the colour override used the same selectors as the skin, so it only won the cascade when parsed later.What the problem was:
editor.cssand its white icon colour wins the tie.wp_editor()printseditor-buttonsinline in the body, after the skin.#f0f0f1background — 1.1:1 contrast.What the fix does:
mce-widgetclass, which TinyMCE puts on every button alongsidemce-btn, to the five existing override selectors.Approach and why:
.mce-toolbar .mce-btn-groupwould also have worked but would drop menubar buttons, which plugins can enable viatiny_mce_before_init.Trac ticket: https://core.trac.wordpress.org/ticket/65768
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Ticket analysis, tests and writing PR. All changes were reviewed and validated by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.