Answers for "tailwind css in react"

CSS
1

tailwind css in react

// craco.config.js
module.exports = {
  style: {
    postcss: {
      plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
      ],
    },
  },
}
Posted by: Guest on August-19-2021
0

tailwind css in react

npx tailwindcss-cli@latest init
Posted by: Guest on August-19-2021
0

tailwind css in react

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
Posted by: Guest on July-12-2021
0

tailwind css in react

{
    // ...
    "scripts": {
-     "start": "react-scripts start",
-     "build": "react-scripts build",
-     "test": "react-scripts test",
+     "start": "craco start",
+     "build": "craco build",
+     "test": "craco test",
      "eject": "react-scripts eject"
    },
  }
Posted by: Guest on August-19-2021
0

tailwind css in react

// tailwind.config.js
module.exports = {
  purge: [],
  darkMode: false, // or 'media' or 'class'
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}
Posted by: Guest on August-28-2021
0

tailwind css in react

// tailwind.config.js
  module.exports = {
-   purge: [],
+   purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
    darkMode: false, // or 'media' or 'class'
    theme: {
      extend: {},
    },
    variants: {
      extend: {},
    },
    plugins: [],
  }
Posted by: Guest on August-28-2021
0

tailwind css in react

npm install @craco/craco
Posted by: Guest on August-19-2021
0

tailwind css in react

/* ./src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
Posted by: Guest on August-28-2021
0

tailwind css in react

// src/index.js
  import React from 'react';
  import ReactDOM from 'react-dom';
+ import './index.css';
  import App from './App';
  import reportWebVitals from './reportWebVitals';

  ReactDOM.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>,
    document.getElementById('root')
  );

  // ...
Posted by: Guest on August-28-2021
0

tailwind css in react

npx create-react-app my-project
cd my-project
Posted by: Guest on August-28-2021

Browse Popular Code Answers by Language