Skip to content

Commit 563bab3

Browse files
authored
mention Tailwind plugin caveat (PlasmoHQ#96)
1 parent 259a7aa commit 563bab3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/pages/quickstarts/with-tailwindcss.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,19 @@ const PlasmoOverlay = () => {
140140

141141
export default PlasmoOverlay
142142
```
143+
144+
<Callout emoji="ℹ️">
145+
Since Tailwind and its' plugins often rely on `:root` to declare CSS variables, be mindful of [Content Scripts UI Styling CSS variables caveat](/framework/content-scripts-ui/styling#css-variables) if using built-in `Root Container`.
146+
147+
For example, if you plan on using [DaisyUI](https://daisyui.com/), you will need to replace `:root` scope with `:host` before attaching the style to the shadowDOM.
148+
149+
```tsx filename="content.tsx"
150+
import cssText from "data-text:~style.css"
151+
152+
export const getStyle = () => {
153+
const style = document.createElement("style")
154+
style.textContent = cssText.replaceAll(':root', ':host(plasmo-csui)');
155+
return style
156+
}
157+
```
158+
</Callout>

0 commit comments

Comments
 (0)