nova-tailwind
nova-tailwind copied to clipboard
Nova 4 support?
Hi,
Can you add support for Nova 4 ? Thank you
Regards
Just tried using some tailwindui
styling on a Nova card and it looked horrid... also keen for a quick-fix of full Tailwind support on Nova 4 🥺
Unfortunately, I don't think it's possible. The new Tailwind is way too big to be included like this. :( I looked into it and the CSS always came out at like 30mb or something.
I think we have to use the new JIT compiler for all the packages. :(
😞
Could you elaborate on how to add full Tailwind / new JIT compiler on a single package @Tarpsvo?
You can see an example in nova-color-field.
https://github.com/outl1ne/nova-color-field/blob/master/tailwind.config.js
https://github.com/outl1ne/nova-color-field/blob/master/resources/css/field.css
https://github.com/outl1ne/nova-color-field/blob/master/webpack.mix.js
@Tarpsvo Thanks for this; I set up a full custom tailwind config in 2 minutes. Thanks to you!
You can see an example in nova-color-field.
https://github.com/outl1ne/nova-color-field/blob/master/tailwind.config.js
https://github.com/outl1ne/nova-color-field/blob/master/resources/css/field.css
https://github.com/outl1ne/nova-color-field/blob/master/webpack.mix.js
There is a hacky way to set up tailwind css for all your nova components in one go. Create an asset, set up tailwind css. Follow the above example. All you have to do is set your path in content array in tailwind.config.js
.
Please keep in mind that above example is for field so you will have to replace field.extension
with asset.extension
for filenames.
content: [
"../../**/*.vue", // Target all the .vue files in your nova-components if this code is inside nova-components
"../../**/*.css", // Target all ".css" file inside nova-components
"../../**/*.scss", // Target all ".css" file inside nova-components
],
Your asset compiled assets will be included by nova automatically. Just make sure you recompile it when you add new classes to other nova components.