Custom TailwindCSS for Badges #4002
Replies: 3 comments 9 replies
-
|
You can't. You have to build your own CSS and load it. See https://nova.laravel.com/docs/4.0/customization/assets.html |
Beta Was this translation helpful? Give feedback.
-
|
I think this issue can be resolved by adding your Nova Resources folder to the Tailwind directories for it to search classes for. |
Beta Was this translation helpful? Give feedback.
-
|
I'm going to throw an idea out there that might be stupid, but the current setup is leading to some suboptimal situations – not only the specific problem outlined in this discussion, but I'm coming up against it when creating custom nova components too. Poking around in a few third-party Nova packages it feels like the approach maintainers are taking is also a bit all over the place. Some are using the prefixed approach described here, some are adding the Tailwind classes they want to use in their own stylesheet (i.e. literally writing It all feels like it's going against what Tailwind with JIT is meant to achieve. It's pretty straightforward to build Nova's CSS in the root of my project, just by putting the following in a nova.css file and adding the file to my vite config: So I guess it would be fairly trivial to copy tailwind.config.js to the root of my project (e,g. as tailwind.nova-config.js), update the content paths, and then add: • This new tailwind config would end up with a config section like this: For this to actually do anything, there would need to be an option in the Nova config that allowed a custom stylesheet path to be provided. If set, this would/should mean the default stylesheet wasn't loaded. But if not set, e.g. on a new nova install, it could just load the stylesheet as normal. This actually doesn't sound that crazy to me. There's one problem this approach doesn't solve and that's third party packages for Nova. But maybe someone else has thoughts for this. I'm a little unsure on this one, the ideas that come to mind are questionable and untested (symlinking nova packages in nova-components automatically post-install? requiring users to add nova packages to some sort of config?) But perhaps someone else has thoughts! Anyway, if this does all sound crazy just ignore me! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Following the example, how do we get those Tailwind classes included in the stylesheet, as they are being purged.
I think this should be included in the doc notes.
Detailed steps to reproduce the issue on a fresh Nova installation:
Beta Was this translation helpful? Give feedback.
All reactions