-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix switcher focus style. #33031
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
Fix switcher focus style. #33031
Conversation
|
Size Change: -33 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
|
Note that the glitchy focus style in all these GIFs is fixed by #33022. Must be a recent rendering engine change. |
| // Ensure the icon buttons remain square. | ||
| &.has-icon { | ||
| // This needs specificity. | ||
| &.has-icon.has-icon { |
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.
What's the double class for?
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.
Short answer: it incrementally increases the specificity of this rule.
Longer answer, it adds specificity to override this inherited padding:
This wasn't necessary in the past, since the icon was centered inside the 48x48 button. But once you add text, such as in reusable blocks, that lower padding will be leveraged. By setting higher specificity and bigger padding, we get it right:
Much longer answer: the block toolbar works decently as is. But having grown organically from features across the years, the CSS is at a level of complexity where it'd be nice to revisit it in a refactor.
|
Thanks for the review! |






Description
The focus style of the switcher is off:
This PR fixes it:
As I look at the code here, the refactor from the old block toolbar style to the new plus recent feature additions have built up the complexity a fair bit. Now that we don't have to support IE11 anymore, I think there's an opportunity to refactor this whole component to be vastly simpler. We'd need to remove some fragments and revisit a few extensibility points and CSS classes, so I'd love someone to pair up with on this — of you're interested, let me know.
How has this been tested?
Insert a block, focus the switcher. The focus style should be square.
Checklist:
*.native.jsfiles for terms that need renaming or removal).