I - Add tailwind to project
Install tailwind via yarn yarn add -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9 Create React App doesn’t support PostCSS 8 yet so you need to install the Tailwind CSS v2.0 PostCSS 7 compatibility build for now as we’ve shown above.
Install Craco yarn add @craco/craco
Edit script in package.json ` "scripts": { "start": "craco start", "build": "craco build", "test": "craco test", "eject": "react-scripts eject" },
create new file craco.config.js // with package.json // craco.config.js module.exports = { style: { postcss: { plugins: [ require('tailwindcss'), require('autoprefixer'), ], }, }, }
generate your tailwind.config.js file: npx tailwindcss-cli@latest init add bellow code to into file tailwind.config.js module.exports = { purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"], darkMode: false, // or 'media' or 'class' theme: { extend: {}, }, variants: { extend: {}, }, plugins: [], };
Yarn start and enjoy the moment
II - Add antd and change default themes