ButtonGroup: Inline z-index#77621
Conversation
|
Size Change: 0 B Total Size: 7.76 MB ℹ️ View Unchanged
|
|
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. |
|
Flaky tests detected in 30f85a0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24847483923
|
There was a problem hiding this comment.
Won't bother to add stacking context isolation like #77619, since this component is long deprecated.
There was a problem hiding this comment.
Should we add a CHANGELOG entry about inling z-index, for the same reasons highlighted in https://github.com/WordPress/gutenberg/pull/77619/changes#r3137231279 ?
There was a problem hiding this comment.
Only the @wordpress/base-styles package needs a changelog, and here's my reasoning: @wordpress/base-styles is a package used at build time. A consumer usage can only possibly break when they update the @wordpress/base-styles package in their project (their z-index reference will be gone), or if we actually change the z-index value in ButtonGroup. Since we're not changing the z-index value in ButtonGroup, the only possible breakage opportunity is when a consumer updates their @wordpress/base-styles.
* ButtonGroup: Inline z-index * Add changelog * Add changelog Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: simison <87168+simison@users.noreply.github.com>

What?
Removes
.components-button {:focus or .is-primary}from the shared$z-layersmap inpackages/base-styles/_z-index.scssand setsz-index: 1directly on the focused or active button inpackages/components/src/button-group/style.scss.Why?
The Button Group button only needs a local stacking value of
1so its focus ring and active border can render above adjacent buttons. Keeping it in the global z-index map added indirection without coordinating with any broader stacking context, so this inlines the value and removes the unused registry entry.Testing Instructions
@wordpress/components(or open a screen that uses Button Group).Components/Deprecated/ButtonGroup, or any screen that uses grouped buttons.z-index: 1is applied.Testing Instructions for Keyboard
Use of AI Tools
Used Cursor to review the diff and draft the PR description. I reviewed the resulting code and text.