tailwindlabs / tailwindcss-setup-examples

674 stars 173 forks source link

Using Tailwind CSS with CRA #46

Open agneym opened 4 years ago

agneym commented 4 years ago

For a recent project, I created a fork of React Scripts and fetches from a tailwind css template pushed to npm.

It can be used with:

npm init react-app folder-name --scripts-version=@agney/rs-tailwind --template=tailwind

Requires @next for now, since some fixes for template are not on major release With the release of 3.3.0, this is now directly supported.

I was wondering if the repositories could be moved here for better maintanence and visiblity.

kaisheng1 commented 4 years ago

Hi, this is a really helpful template so far I can find. However, can you share how you build this template, cause I'm wondering if I can do the same thing.

kaisheng1 commented 4 years ago

Found a brilliant template here: https://github.com/GeoffSelby/cra-template-tailwindcss. Check this repo if you would. I still want to know how you built your own template though.

agneym commented 4 years ago

@kaisheng1 The template you linked to uses a package named craco to customise the CRA from the outside. Mine uses a custom package that is self made: create-react-app-tailwind that is forked from create-react-app which is customised to include tailwind and postcss.

Auth0 has a nice tutorial on how to customise one on your own.

kaisheng1 commented 4 years ago

Yeah, I was just wandering around and find the best way to do stuff. Would be really cool to make my own custom package, if it's necessary.