-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polish the focus style for the segmented control. #33842
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically there appears to be a bug in how the ${ CONFIG.controlBoxShadowFocus }; variable is output. It generates the following incorrect box shadow, which then doesn't render at all:
Great catch Joen! I pushed an update to fix the value and updated the tests where needed.
Size Change: -4 B (0%) Total Size: 1.08 MB
ℹ️ View Unchanged
|
Ah, thanks for doing that, it's good education for me to see where these properties are stored! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can 🚢
Nice, thanks for the help! |
Description
Followup to feedback in #31937 (comment), this PR polishes the focus style for the new Segmented Control. Before:
After:
The focus style for buttons, unputs and selected blocks across the block editor is 1.5px blue focusring, which changes the shape from 1px inputs or controls, or sits outset of solid blue primary buttons.
In this case, the usage of focus-within feels correct, as when you tab to the segmented control, pressing tab again sets focus on the next control, not the next option inside; you have to use the arrow keys to change the property inside.
Note: This PR is a draft because it needs a bit more work. Specifically there appears to be a bug in how the
${ CONFIG.controlBoxShadowFocus };
variable is output. It generates the following incorrect box shadow, which then doesn't render at all:The two commas are wrong. Here's how it should be:
This PR simply outputs the corrected value directly, but ideally we find a way to output the variable correctly before we land this. If you know how to, please feel free to push directly to this branch.
How has this been tested?
Insert a "Post Featured Image" block and focus the segmented control in the inspector.
Checklist:
*.native.js
files for terms that need renaming or removal).