Conversation
|
Size Change: -1.91 kB (-0.03%) Total Size: 6.84 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
There was a problem hiding this comment.
I agree that we should not introduce a custom UI for now.
I also suggest removing hard-coded colors and styles.
- Apply only offsets to outlines. Use browser default styles for outline width, style, and color.
- Don't apply hover styles.
- Don't rely on global style presets.
What do you think about making the following changes?
diff --git a/packages/block-library/src/tabs-menu-item/style.scss b/packages/block-library/src/tabs-menu-item/style.scss
index 4d18b9d4d28..b61fb705b64 100644
--- a/packages/block-library/src/tabs-menu-item/style.scss
+++ b/packages/block-library/src/tabs-menu-item/style.scss
@@ -15,8 +15,7 @@
-webkit-appearance: none;
margin: 0;
- padding-block: var(--wp--preset--spacing--20, 0.5em);
- padding-inline: var(--wp--preset--spacing--30, 1em);
+ padding: 0.5em 1em;
// Inherit typography from parent
font-size: inherit;
@@ -27,20 +26,10 @@
text-transform: inherit;
text-align: inherit;
- &:focus {
- outline: none;
- }
-
&:focus-visible {
- outline: 2px solid #000;
outline-offset: 2px;
}
- &:hover {
- background-color: #eaeaea;
- color: #000;
- }
-
&[aria-selected="true"],
&.is-active {
background-color: #000;|
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. |
Sounds good! I like the idea of keeping the styling as minimal as possible for now. I've pushed those changes in e8d4aa2. |
scruffian
left a comment
There was a problem hiding this comment.
Left a few thoughts but nothing that should stop us merging.
|
Looks like there are some things in block-library/src/tabs-menu-item/editor.scss that also need to be removed. |
|
Flaky tests detected in 963a692. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22234020622
|
|
Thanks both! Will get this merged. |
What?
Addresses part of the discussion in #73230 for removing the ad-hoc styling controls from the Tab Menu Item block.
Why?
Ideally, no blocks included in the block library should use their own custom solutions for styling, and instead should use shared tools available to all blocks.
In this case, in the near future, it would be great if this block could use a solution based on the work in #75627.
How?
Removes the following styling controls from the Tab Menu Item block: activeBackgroundColor, activeTextColor, customActiveBackgroundColor, customActiveTextColor, customHoverBackgroundColor, customHoverTextColor, hoverBackgroundColor, hoverTextColor
Testing Instructions
Screenshots or screencast