setup tailwind

This commit is contained in:
Seth Trowbridge 2024-10-10 20:07:20 -04:00
parent 7bf5ff926a
commit 4f587c47cb
7 changed files with 1123 additions and 4 deletions

1097
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,14 @@
"@types/react": "^18.3.3", "@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.5.0", "@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.0", "eslint": "^9.9.0",
"eslint-plugin-react": "^7.37.0", "eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9", "eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0", "globals": "^15.9.0",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.13",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"typescript-eslint": "^8.0.1", "typescript-eslint": "^8.0.1",
"vite": "^5.4.1" "vite": "^5.4.1"

6
postcss.config.js Normal file
View File

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -2,7 +2,7 @@ import React from 'react'
export default function App() { export default function App() {
const [count, setCount] = React.useState(0) const [count, setCount] = React.useState(0)
return <button onClick={() => setCount((count) => count + 1)}> return <button className="p-4 bg-red-500 text-white" onClick={() => setCount((count) => count + 1)}>
count is {count} count is? {count}
</button>; </button>;
} }

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import ReactDOM from 'react-dom/client' import ReactDOM from 'react-dom/client'
import App from './App'; import App from './App'
import "./tailwind.css"
const root = document.getElementById('root'); const root = document.getElementById('root');
root && ReactDOM.createRoot(root).render(<React.StrictMode><App /></React.StrictMode>); root && ReactDOM.createRoot(root).render(<React.StrictMode><App /></React.StrictMode>);

3
src/tailwind.css Normal file
View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

11
tailwind.config.js Normal file
View File

@ -0,0 +1,11 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}