tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

nuxt config.css priority High than module config

Open oooplz opened this issue 6 years ago • 6 comments

Config nuxt.config.js css option. My css option value is

export default { css: ['a.css', 'tailwind.css'] }

But in runtime 'tailwind.css' priority High than 'a.css'. it will override 'a.css' same css rule. because tailwindcss-module auto insert 'tailwind.css' in head for config.css value

So i suggest : nuxt config.css priority High than module config. when config.css has 'tailwind.css'. module will skip css insert option.

oooplz avatar May 18 '20 01:05 oooplz

Actually you should not set the tailwind.css since the module add it for you, see https://github.com/nuxt-community/tailwindcss-module/blob/master/lib/module.js#L26

atinux avatar May 22 '20 17:05 atinux

@Atinux Is there any way to disable the auto-injection of the tailwind.css file?

Injecting before all other CSS is a nice feature but I've run into times when it needs to come after all other CSS declared in the global CSS config.

It'd be nice to be able to disable auto-injection and manually include it.

sei-jdshimkoski avatar Jul 14 '20 23:07 sei-jdshimkoski

Looking at the code, I guess I could try to set the cssPath config option to "", then just manually add the tailwind.css file in the nuxt.config.js CSS option.

Will give that a try and see what happens.

sei-jdshimkoski avatar Jul 14 '20 23:07 sei-jdshimkoski

Well, that was a complete failure. Was worth a shot but hacky anyway.

Hopefully, a future version of this will enable the ability to disable auto-injection of the tailwind.css file.

sei-jdshimkoski avatar Jul 15 '20 00:07 sei-jdshimkoski

What about having cssPath: false to disable adding the CSS?

This could be done easily with a PR @sei-jdshimkoski

atinux avatar Jul 16 '20 21:07 atinux

That would be rad. Hopefully, I can find time over the next few weeks to code something up (if someone beats me to it, that's cool too) :).

sei-jdshimkoski avatar Jul 17 '20 13:07 sei-jdshimkoski