-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Some components are missing box-sizing
reset styles
#42415
Comments
I'm also not exactly sure about how this issue hasn't been flagged before 🤯
Sounds good. In SCSS files, I would also add a comment pointing at that Emotion equivalent mixin for when the component is refactored to CSS-in-JS ?
Sounds good on paper — in practice it may need a bit more investigation, in case this change causes any regressions.
Sounds good
Not sure about this — I'm a big fan of consistency, and in a way I like the idea that a developer could assume that all components from the library have I'm sure that applying these styles may cause a few regressions, but I would argue that it's better to find and fix regressions caused "willingly", than keeping the styles as they are currently and incur in issues similar to #42294 every once in a whilte |
We might consider adding a single "component reset" mixin that we include in the top-level wrapper of each component, which would include the border sizing reset, font-size/line-height, color, etc. |
Yes, I agree this is the ideal state. It's more a matter of triage that I suggested not doing a package-wide fix, given the amount of effort it would take to apply the reset to every single component. The good news is that, box-sizing problems are easier to notice now with the CSS switcher in Storybook (#42747) — the default preset doesn't have any box-sizing resets. |
This sounds like a good idea!
Sounds good. I guess we can work our way gradually (in order to avoid the risks of a one-shot, package-wide fix), with the ultimate aim of having all components "box-sized" equally |
What problem does this address?
#42294 surfaced two problems:
:root
-levelbox-sizing
resets. In fact, the resets are applied on specific sections of the UI, making it pretty unpredictable from the standpoint of a component.box-sizing
rules are currently applied to components in an ad hoc way. Many components are likely missing them, and they can be hard to notice because of Storybook: CSS resets intended for the Block Editor Playground are leaking #42414.What is your proposed solution?
I think we're going to need to start checking that each component includes box-sizing resets for their own HTML subtree. The approach would be something like:
reset
mixin.reset
mixin equivalent for the Emotion components. (But give it a more explicit name likeboxSizingReset
.)View
component?This is not necessarily meant as a "project" where we need to clean up every component in the package, but something that we should start cleaning up in a consistent way whenever we notice box-sizing issues in a given component.
The text was updated successfully, but these errors were encountered: