You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I built a Nuxt module to externalise and reuse header and footer components across a number of applications that share the same design system. This module uses tailwind 4 with a CSS config. When this module is enabled in a parent application, that application's @source safelisting breaks for classes with media queries – for example sm:py-14 will work, but py-12 sm:py-24 will only apply py-12, regardless of which class comes first.
In my module'smain.css file I added this line to enable tailwind in components: @source '../../../runtime/components';
In the parent app that uses the module, there's a number of imports such as:
Where safelist.css contains all the @source declarations for classes I want safelisted.
I think the issue is how @source is being compiled in the parent app – or maybe where it's being declared in the module, but as I said, I'm pretty new to module-building so if anyone could point me in the right direction, I'd be very grateful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I built a Nuxt module to externalise and reuse header and footer components across a number of applications that share the same design system. This module uses tailwind 4 with a CSS config. When this module is enabled in a parent application, that application's
@source
safelisting breaks for classes with media queries – for examplesm:py-14
will work, butpy-12 sm:py-24
will only applypy-12
, regardless of which class comes first.In my module's
main.css
file I added this line to enable tailwind in components:@source '../../../runtime/components';
In the parent app that uses the module, there's a number of imports such as:
Where
safelist.css
contains all the@source
declarations for classes I want safelisted.I think the issue is how
@source
is being compiled in the parent app – or maybe where it's being declared in the module, but as I said, I'm pretty new to module-building so if anyone could point me in the right direction, I'd be very grateful.Beta Was this translation helpful? Give feedback.
All reactions