Repository navigation
Conversation
🤖 PR meta 🤖👋 Welcome👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Pathan-Amaankhan! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. 🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
…x/storybook-max-width-wrapper-contrast
|
Thanks @mirka, that's a better fit. In 3e3c885, I switched the label to the muted combination: I checked it with axe in the light, dark, and two custom themes, and the Max-Width Wrapper label itself reports no color-contrast violation in any of them. |

What?
Closes #86474
Restyles the "Max-Width Wrapper - …px" label that Storybook shows under a story when a Max-Width Wrapper is selected, using design tokens so it passes the color-contrast check and follows the selected theme.
Why?
The label used
#757575on#e0e0e0at11px, a contrast ratio of 3.49:1. That fails the 4.5:1color-contrastcheck, so the Accessibility panel reported a serious violation for any story shown with a wrapper, even though the label belongs to Storybook and not to a component.The hard-coded colors also didn't follow the theme switcher, so the label looked the same in every theme.
The wrapper defaults to "None", so the story accessibility checks normally run without the label.
How?
Replaces the hard-coded colors in
storybook/decorators/with-max-width-wrapper.module.scsswith the muted combination suggested in the review:--wpds-color-foreground-content-neutral-weaktext on--wpds-color-background-surface-neutral, with a--wpds-color-stroke-surface-neutralborder. The tokens follow the theme selected in the toolbar.box-sizing: border-boxkeeps the label32pxtall now that it has a border.Testing Instructions
npm run storybook:devand open any story, for example, Components /@wordpress/ui/ Badge / Default.color-contrastviolation for the "Max-Width Wrapper - 960px" label.Testing Instructions for Keyboard
Not applicable: this only changes the look of a label.
Screenshots or screencast