-
Notifications
You must be signed in to change notification settings - Fork 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
Components: remove global CSS reset in button #37026
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
This reset style is needed to make <button>
elements unstyled by default, and make them look as close to a <div>
as possible.
Removing it breaks a lot of places where we use <button>
to create accessible clickable things that don't look like a classic button:
Media Library Items: (notice the unwanted border)
Site Icon: (broken InfoPopover
icon and clickable site icon image)
Change Username link in Login:
A better solution would be to move the reset to the reset.scss
stylesheet. It's really a reset rather than styling specific to Calypso design.
Thanks for having a look Jarda! Yepp, I realized the same yesterday, only set this ready for review little too early. 😁 Fixed! I'd leave |
055bf45
to
b4c920b
Compare
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.
This appears to be working well for me.
I modified the Changelog a bit (see) and asked one question.
All in all, looking good to 🚢
...handled already by Autoprefixer.
...handled already by Autoprefixer.
Here's a follow-up PR to further re-work some of the button CSS: #37103 |
Changes proposed in this Pull Request
Remove
button
CSS reset from the button component and add it to Calypso CSS reset stylesheet.I looked at each reset rule separately —
Needed
background
: this reset is needed in the component. Only related style.button
sets isbackground-color
.Not needed
border
: the shorthand setsborder-width
,border-style
, andborder-color
and each of those already is in the.button
. Should this still be included in case someone removes one of those in the future?Were already in
.button
and can be removed as duplicateoutline
padding
font-size
-webkit-appearance
appearance
vertical-align
We cannot use
all:unset
rule here since it lacks IE support: https://developer.mozilla.org/en-US/docs/Web/CSS/all#Browser_compatibility :-(Testing instructions
<button>
elements without.button
class don't changehttp://calypso.localhost:3000/devdocs/design/button