I am building a third party web component in Vue, which relies on Tailwindcss fairly heavily for most of its styles.
The shadow-dom of the web component encapsulates most of the styling and css so that there is (mostly) no bleed through of styles from the webpage where the web component sits to the interior of the shadow dom, and vice versa.
However, Tailwind uses rem based values for sizing almost all its fonts, padding, height, width, etc.
I just discovered that apparently the one exception where styles from the parent page bleed into the shadow-dom is that the shadow-dom will inherent the base font-size set in the html{ } section of the main page's stylesheet into the shadow-dom.
Since rem-based values inherit from the parent's html{} block, this means that all of my Tailwind-based heights, fonts, padding, etc wind up getting arbitrarily resized if the subject page has set a font-size in their page's html {} block that is set to anything other than 16px.
Before I go back and try to strip Tailwind completely out from my component, is there any way I can prevent the shadow-dom from inheriting the font-size from the html {} block of the main page? It seems pretty ridiculous for a web component to provide nearly all encapsulated styles, only to be forced to inherit the root font-size from the page.
I have tried overriding the font-size with !important, and also by trying to wrap the component in another tag, but neither seem to work.