We've moved discussions to Discord

Tailwind's @apply in application.scss

Abhinav Saxena
Hi all,

 Do we need to set up anything else to get TW @apply working in css files? I am trying to create a couple of css classes in which I want to use @apply to use bg-color properties.




John Quarto-vonTivadar
if you're using the TW 1.8 or 1.9 that comes with Jumpstart Pro, then you might need to add this in your tailwind.config file

  `experimental: {
    applyComplexClasses: true,`

if you're using TW 2, then this is no longer experimental so just ignore this comment :)
Abhinav Saxena
Thanks a lot.

Apparently, stylesheets in app/assets/stylesheets aren't configured to use @apply - Jumpstart CSS is present under app/javascript/stylesheets/components and @apply method can be used there. 
John Quarto-vonTivadar
I know this is a year later, but you could always put your custom CSS in a .scss file and import it (right after base.scss, components.scss, and utilities.scss) in your javascript pack file
Notifications
You’re not receiving notifications from this thread.