Repository navigation
Refactor the Settings button CSS. - #14475
Conversation
|
Nice. Tab, hover, focus, look good. There's a small subtle change with the selected state that we should fix. The radius is off, and there's some shimminess around the corners. I've zoomed in these so it's visible. Before: After: Two ways to fix this.
To accomlpish 2, you'd need to find the spot in the code that compiles into this: And change the height to 36, and line-height to 35. That would make it look like this: But that's sort of a big change. Since we mean to revisit buttons and their focus states across WordPress, perhaps it's best to go with option 1 for now? |
|
Curious that a solid box-shadow doesn't fully cover the background. Yep I'd go with padding: 7px and margin 1px. |
|
Done. |
|
A bit busy today so can't review, but putting it in a milestone because the changes look good at a code glance. |
kjellr
left a comment
There was a problem hiding this comment.
Thanks, @afercia! These changes look good. It's unfortunate to have to use an !important override all those button :not()'s, but I think it's more or less fine to do it in this specific case.
I noticed that the height of this button — and all the other toolbar buttons — are different from the height of the text buttons, but seems like that's always been the case, so we can think about that separately:
* Refactor the Settings button CSS. * Remove box-shadow use padding and margin.
* Refactor the Settings button CSS. * Remove box-shadow use padding and margin.
* Refactor the Settings button CSS. * Remove box-shadow use padding and margin.




Fixes #14474.
This PR seeks to solve a Firefox / NVDA bug where changes to the Settings button
aria-expandedstate are not announced because of the CSS pseudo-element used for styling. For more details, please see the related issue #14474.I've opted to just remove the CSS pseudo element and re-implement the styling by other means.
Worth nothing the
.is-toggled:hoverstate didn't work as intended, not even on master. I had to use!importantto override a pile of:not()selectors used in the icon-button. Adding one more:not()there didn't seem to me the best option.The CSS should replicate the current styling. Do feel free to change it if desired, but please don't use a CSS pseudo-element 🙂
/Cc @jasmussen
Screenshot (for comparison, see the GIF on the issue):