You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trouble however is that some sites have this weird rem reset method where they set html { font-size: 62.5% }. Now because TailwindCSS uses rem, this obviously messes up all the styles applied in the overlay of my content script.
The issue visualized in a simple repro:
You can't tell, but the size of the overlay is scaled down (h-20 is 80px, while it's rendered at 50px, etc).
It's weird because even though the manually set font-size: 62.5% appears to be overwritten by both text-base and font-size: 16px !important; all: initial !important;, it's still scaling down the entire overlay, because Tailwind sees the base as 62.5%, not 100%. So clearly the reset is not working and the host styles are still bleeding in.
How do you do the reset to ensure things like these aren't conflicting?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm running Svelte with TailwindCSS. Here's my content script setup:
The trouble however is that some sites have this weird rem reset method where they set
html { font-size: 62.5% }
. Now because TailwindCSS usesrem
, this obviously messes up all the styles applied in the overlay of my content script.The issue visualized in a simple repro:
You can't tell, but the size of the overlay is scaled down (
h-20
is80px
, while it's rendered at50px
, etc).It's weird because even though the manually set
font-size: 62.5%
appears to be overwritten by bothtext-base
andfont-size: 16px !important; all: initial !important;
, it's still scaling down the entire overlay, because Tailwind sees the base as62.5%
, not100%
. So clearly the reset is not working and the host styles are still bleeding in.How do you do the reset to ensure things like these aren't conflicting?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions