DEV Community

Discussion on: Setup create-react-app with Tailwind CSS

Collapse
 
ptmdmusique profile image
ptmdmusique

Hi Nards, thank you very much for the great post!
I tried to follow the instruction above and it works perfectly fine with the className stuff. However, I couldn't figure out how to make directives such as @apply to work with both CSS and SASS files (I got unknown property when I inspect the elements with Chrome Inspector).
Have you ever made those directives work before?

Collapse
 
nards_paragas profile image
Nards Paragas • Edited

Thanks for the feedback!

I haven't tried using directives to extent yet but I'm assuming this one's related to PostCSS. Sorry I have no solid answer now but I'll try to look and get back into this once I'm free.

Collapse
 
ptmdmusique profile image
ptmdmusique • Edited

Hi Nards,

Thanks for the quick reply! Apparently, I had to override webpack config (not really recommended) using react-app-rewired and customize-cra with some PostCSS config.
The very short tutorial I use is : medium.com/@harryhedger/quick-how-...

If possible, please test this and (maybe?) note this for users who use create-react-app with Tailwind directives so that they don't have to look everywhere like me anymore! Thanks :D

Thread Thread
 
nards_paragas profile image
Nards Paragas

Thanks for this! Will pin this one on the post itself later. Sorry for the late response!