tailwind css classes not working in custom theme
I'm asking this here because I don't think it's a purely tailwindcss issue. I think it's related to custom themes. I'm trying to use
bg-slate-100
, but no matter what I do, I can't get it to show up in my rendered view.
I did the following:
1) I created the custom theme
2) I added the file I need to get the styles from to the content array in the tailwind.config.js
file.
3) I ran npm run build
.
4) I'm referencing the css file like so in my layout file (separate layout file from the main one): <link href="{{ asset('css/filament/filament/app.css') }}" rel="stylesheet" />
5) I also added the colors plugin to the tailwind.config.js
file, but I'm not sure that was necessary.
I can dd
the view and see that the class is in the markup, but it's not rendering. There are a couple of other styles that seem to not be rendering, but it doesn't seem like it's all the styles.
Here's my tailwind.config.js file:
The page that I want to use the CSS file on is outside of the normal filament tenant, but I'm thinking it should still work the same way if I'm referencing the CSS file. I can't find the value #f1f5f9 in the compiled css file either, which is the slate-100 color.3 Replies
Can you share your
vite.config.js
?
Or how do you compile your file?Solution
Also you should use
@vite
instead of <link href="asset(">
ahh ok. This is my first project with both vite and tailwind, so I'm probably doing all kinds of things wrong.
using @vite fixed it.
🙄