Open danbaechtold opened 1 month ago
Have you tried to put those paths inside content.files
in your tailwind.config.ts
?
@benjamincanac I tried now, but it didn't solve it.
Can you provide a reproduction then?
I can't, because storyblok would require an access token to work.
But the case is quite simple: When adding a class, say "my-10" anywhere in say, "./app/components/MyComponent.vue", it works, but if I put the same class with the same code, but just in another location, say, "./app/storyblok/MyComponent.vue", it doesn't work.
Can you not provide a reproduction without storyblok like you mentioned then?
@danbaechtold I also use storyblok, and added the path the same way you did. It's working fine on my end.
Have you tried a clean up npx nuxt cleanup
? Or have you checked it is getting the updated tailwind config, sometimes Nuxt needs a restart.
I've found the solution:
By adding this to nuxt.config.ts, it works:
components: {
dirs: [
{
path: '~/storyblok',
global: true
},
'~/components'
]
},
(No change is required in tailwind.config.ts (namely, the "content" config I showed above is not required)).
So.. is it a bug? Does it only happen depending on the order of the registered modules for example? I don't know. But let me know if you need anything else from my end, and thank you guys for your help.
Ah.. maybe this could help, at some point I got these WARN logs with the old setup:
WARN warn - The purge/content options have changed in Tailwind CSS v3.0.
WARN warn - Update your configuration file to eliminate this warning.
WARN warn - https://tailwindcss.com/docs/upgrade-guide#configure-content-sources
Checking the link it seems it could very well be related to my issue..
This issue is stale because it has been open for 30 days with no activity.
Environment
Version
@nuxt/ui-pro@1.3.1, @nuxt/ui@2.17.0
Reproduction
none
Description
When using Tailwind classes in a 'normal' component, the class usage will be detected and it will be put in the generated CSS, all good.
But when using Tailwind classes in a component defined anywhere outside of the default ./components directory, say,
./storyblok/Section.vue
, the class usage will not be detected and they will be missing in the generated CSS.I've tried to add the path to the "content" config like this (tailwind.config.ts), but it doesn't seem to have any effect:
My guess is that the problem lies in ui/src/tailwind.ts: There, the directories are hardcoded and seem to ignore the "content" config.
Additional context
No response
Logs
No response