Roots Discourse

Tailwind components

I’ve installed sage 9 using composer and selected Tailwind as framework.
Have successfully made changes to the tailwind.config, but wondering about making TW Components.
Tried to use the @layer function in my main.scss and it gets pulled up by yarn lint as an error.
Do I need to edit something else to use them?


The tailwind you’re getting with Sage composer is the 1.9.x version, IIRC the @layer directive has been introduced with 2.0.
If you’d like to get Tailwind 2, you can read this thread.

I worked out it was an older version of TW, but it looked in the TW docs like @layer was there.
So that makes sense.
I will check out the thread too, @layer seems useful.

You may find this feature branch/fork interesting that uses webpack5 with latest dependencies, including Tailwind:

I’m reading the tailwind 1.9 docs and @layer is there.
So i’m back to not understanding why it doesn’t work.

This topic was automatically closed after 42 days. New replies are no longer allowed.