Skip to content

Instantly share code, notes, and snippets.

@codewithleader
Last active December 10, 2024 17:44
Show Gist options
  • Save codewithleader/0ffc713eafdd9eaec6fbb99133dc8ed5 to your computer and use it in GitHub Desktop.
Save codewithleader/0ffc713eafdd9eaec6fbb99133dc8ed5 to your computer and use it in GitHub Desktop.
Tailwindcss - Configuración en React y VueJS
  • How to install TailwindCSS in ReactJS+Vite
  1. Install dependencies
npm i -D tailwindcss postcss autoprefixer
  1. Run npx command
npx tailwindcss init -p
  1. Configure the tailwind.config.ts file
/** @type {import('tailwindcss').Config} */
export default {
  content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
  theme: {
    extend: {},
  },
  plugins: [],
};
  1. Add the Tailwind directives to src/index.css file
@tailwind base;
@tailwind components;
@tailwind utilities;

Para VueJS:

/** @type {import('tailwindcss').Config} */
export default {
  content: ['./index.html', './src/**/*.{vue,js,jsx,ts,tsx}'], // Para Vue, Si es React omitir ese
  theme: {
    extend: {},
  },
  plugins: [],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment