Conversation
Classic themes apply colors and focus/hover styles to button elements with high specificity, which leaks into the Tab block's toggle button. Mirror the Accordion Heading toggle approach so tabs inherit the surrounding colors and present a predictable focus outline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The reset styles for .wp-block-tab were adapted from the accordion heading toggle, and the inline comment still referenced "accordion toggle buttons". Update it to describe tab buttons so the rationale matches the selector. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +152 B (0%) Total Size: 7.78 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 6585d3f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24919254220
|
| background-color: inherit !important; | ||
| color: inherit !important; |
There was a problem hiding this comment.
In a case with user-defined custom colors, do you know if we can be sure that the custom colors styles will always be loaded after classic.css? 😅 Looks a bit precarious at the moment, but maybe fine if the order is guaranteed.
(I'm not familiar with these block library features, so I might be missing things.)
There was a problem hiding this comment.
Nice catch! We can prioritize user-defined colors by checking for the CSS classes has-text-color or has-background.
Fixed in 6585d3f
Scope the inherit !important resets so they apply only when the tab does not carry has-text-color or has-background classes, allowing explicitly chosen colors to take effect under classic themes.
mirka
left a comment
There was a problem hiding this comment.
Nice, let's go with that then 👍
* Tabs: Add classic theme styles to reset button defaults Classic themes apply colors and focus/hover styles to button elements with high specificity, which leaks into the Tab block's toggle button. Mirror the Accordion Heading toggle approach so tabs inherit the surrounding colors and present a predictable focus outline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Tabs: Fix misleading comment copied from accordion styles The reset styles for .wp-block-tab were adapted from the accordion heading toggle, and the inline comment still referenced "accordion toggle buttons". Update it to describe tab buttons so the rationale matches the selector. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Tabs: Preserve user-defined colors against classic theme reset Scope the inherit !important resets so they apply only when the tab does not carry has-text-color or has-background classes, allowing explicitly chosen colors to take effect under classic themes. --------- Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>

Related to: #73454
See: #75402 (comment)
What?
This PR provides a default tab button style for the classic theme.
Why?
Many classic themes apply styles to the button element. Due to the influence of these styles, active tabs may not be displayed correctly or may result in an unnatural design.
How?
To ensure that the default style is displayed appropriately in all themes, we will add minimal styles.
Testing Instructions
Enable any theme to check the tab styles.
Screenshots or screencast
Use of AI Tools
N/A