Help setting up solid-element with tailwind #2038
-
I'm trying to use tailwind with In an @tailwind base;
@tailwind components;
@tailwind utilities; Then in my main solid component, at the top: import './index.css'; That works just fine when I use the normal render method. When I try to use I've tried In the solid-element docs, it makes a brief reference saying how it uses ShadyCSS or something so that CSS works in the shadow dom, but it does not go into details, I got the impression it should "just work". I stumbled on one solution that involved making a sold element just for loading styles, that would look at the vite manifest, figure out the CSS file location, then use that to add a Here is a working demo that illustrates the problem: https://studio.webcomponents.dev/edit/G9X3VwSP2NuNi3QbRJpn/README.md?p=stories See how there are 2 stories... one that uses the solid component directly, you'll see the CSS works fine. One uses custom element and it looses the styling. Note that the demo just imports a CSS file as a simplified demo, since that is how I was trying to do it, import a css file that had the tailwind generated stuff in it. I'd be open to other ways to get at the tailwind code though. tl;dr: Trying to get vite + solidjs + |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Can you try doing |
Beta Was this translation helpful? Give feedback.
Can you try doing
import styles from './index.css?inline';
?