Tab Menu Item: simplify active tab menu item style#77195
Conversation
|
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: -410 B (-0.01%) Total Size: 7.74 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 08c0b77. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24393664183
|
mikachan
left a comment
There was a problem hiding this comment.
This is working as described 🙌
I think the core block should offer the most primitive style possible.
I agree, and I think using a border with currentColor is a good way to achieve this.
It looks like the Tabs Menu block.json is still declaring a style path, should this be removed? ("style": "file:./style-index.css")
|
Couldn't we just make use of the @current state and style it using that? |
Nice idea, I'd like to try that approach in a follow-up. |
mikachan
left a comment
There was a problem hiding this comment.
Thanks for the changes! This looks good to me. It would be great to try @current in a follow-up.
See #75731 (comment)
What?
Try to improve the styling of the active tab to make it work better in more contexts.
Why?
The current active tab has its color and background color hardcoded. This can lead to the active tab menu item being invisible depending on the theme's background color. I think the core block should offer the most primitive style possible.
How?
In this PR, I tried a style that is as simple as possible and independent of context. Below the active tab menu item, draw a 2px border with a color equivalent to the text color.
I used pseudo-elements for two main reasons:
Testing Instructions
To ensure the styles are correctly tested, it's probably best to delete the
builddirectory once. Otherwise, the deletedtabs-menu/style.scssmight be applied unintentionally.Screenshots or screencast
For TT5, the focus style is as follows.
Focused:
Active and focused:
Use of AI Tools
None