Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix box-sizing for shadow-dom elements #1111

Merged
merged 2 commits into from
Oct 29, 2019

Conversation

hacknug
Copy link
Contributor

@hacknug hacknug commented Sep 6, 2019

As discussed on Discord, this PR changes the way we reset box-sizing in our base/preflight styles.

Context

Previously we were setting it on <html> and letting everyone else inherit from there. Sadly, this approach doesn't take into account elements dependent on the shadow-dom.

Since we don't have control over those elements, we can only do one of this:

  • Explicitly set box-sizing for every element and pseudo-element
  • Target the shadow-<div> inside <details>

Second approach would make this change safer but require us to keep adding things to our reset as users encounter new issues with other existing or future elements. PR implements the first option as it was also the one chosen at cssremedy.

Hopefully nothing breaks because of this change 馃

@hacknug
Copy link
Contributor Author

hacknug commented Oct 28, 2019

@adamwathan could you take a look at this for v1.2.0? Let me know if you need me to change/research/test anything before merging. I'm not as afk as I was last week :D

@adamwathan adamwathan merged commit 163ab05 into tailwindlabs:master Oct 29, 2019
@adamwathan
Copy link
Member

Seems good, thanks!

maco added a commit to maco/react-spinners that referenced this pull request Feb 14, 2020
Recent versions of Tailwind CSS force everything to `box-sizing: border-box;`
(see tailwindlabs/tailwindcss#1111 )
Tailwind isn't the only thing out there using that hack, so this is sure to be a wider-ranging problem.
The result of using Tailwind & react-spinners in the same project without this change is that the spinner circle wobbles around.
davidhu2000 added a commit to davidhu2000/react-spinners that referenced this pull request May 2, 2020
Recent versions of Tailwind CSS force everything to `box-sizing: border-box;`
(see tailwindlabs/tailwindcss#1111 )
Tailwind isn't the only thing out there using that hack, so this is sure to be a wider-ranging problem.
The result of using Tailwind & react-spinners in the same project without this change is that the spinner circle wobbles around.

Co-authored-by: David Hu <davidhu314@gmail.com>
scottju1 added a commit to scottju1/react-spinners that referenced this pull request Jun 13, 2023
Recent versions of Tailwind CSS force everything to `box-sizing: border-box;`
(see tailwindlabs/tailwindcss#1111 )
Tailwind isn't the only thing out there using that hack, so this is sure to be a wider-ranging problem.
The result of using Tailwind & react-spinners in the same project without this change is that the spinner circle wobbles around.

Co-authored-by: David Hu <davidhu314@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants