add tailwind

This commit is contained in:
Seth Trowbridge 2024-10-09 05:29:14 -04:00
parent 8c1f86a857
commit 9aac4a631c
7 changed files with 1122 additions and 2 deletions

1097
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,7 @@
"@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-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
@ -26,7 +27,9 @@
"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",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"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

@ -2,5 +2,7 @@ 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} */
module.exports = {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}