-
Describe the bugI am dynamically injecting a container component using the injectTailwind function. What I expect is that the dynamically created component displays with the Tailwind CSS styles (such as h-[300px], bg-slate-50, dark:bg-slate-900, etc.). What is actually happening is that the container renders without any Tailwind styling. ReproductionSteps to reproduce
System InfoSystem:
OS: Windows 11 10.0.26100
CPU: (16) x64 Intel(R) Core(TM) i5-14400F
Memory: 15.31 GB / 31.83 GB
Binaries:
Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
pnpm: 10.4.0 - ~\AppData\Roaming\npm\pnpm.CMD
Browsers:
Edge: Chromium (133.0.3065.59)
npmPackages:
wxt: ^0.17.0 => 0.17.12 Used Package Managernpm Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
You are using a shadow root UI for your main UI. So the styles are isolated to that UI only. When you add a new UI outside the shadow root, your original styles aren't applied. So you need to call |
Beta Was this translation helpful? Give feedback.
I've been able to fix it by just injecting the style element with the tailwind classes as a string