Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 55c8eae

Browse files
committedJul 29, 2024
add tailwind configs
1 parent bf32cad commit 55c8eae

File tree

7 files changed

+1209
-21
lines changed

7 files changed

+1209
-21
lines changed
 

‎package-lock.json

Lines changed: 1163 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
"@types/react": "^18.3.3",
1818
"@types/react-dom": "^18.3.0",
1919
"@vitejs/plugin-react": "^4.3.1",
20+
"autoprefixer": "^10.4.19",
2021
"eslint": "^8.57.0",
2122
"eslint-plugin-react": "^7.34.3",
2223
"eslint-plugin-react-hooks": "^4.6.2",
2324
"eslint-plugin-react-refresh": "^0.4.7",
25+
"postcss": "^8.4.40",
26+
"tailwindcss": "^3.4.7",
2427
"vite": "^5.3.4"
2528
}
2629
}

‎postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

‎src/App.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77

88
.logo {
9-
height: 6em;
9+
height: 10em;
1010
padding: 1.5em;
1111
will-change: filter;
1212
transition: filter 300ms;
@@ -17,6 +17,9 @@
1717
.logo.react:hover {
1818
filter: drop-shadow(0 0 2em #61dafbaa);
1919
}
20+
.logo.tailwind:hover {
21+
filter: drop-shadow(0 0 2em #38bdf8aa);
22+
}
2023

2124
@keyframes logo-spin {
2225
from {

‎src/App.jsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import viteLogo from '/vite.svg'
4-
import './App.css'
1+
import { useState } from 'react';
2+
import reactLogo from './assets/react.svg';
3+
import viteLogo from '/vite.svg';
4+
import './App.css';
55

66
function App() {
7-
const [count, setCount] = useState(0)
7+
const [count, setCount] = useState(0);
8+
9+
const tailwindcssSrc =
10+
'https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Tailwind_CSS_Logo.svg/512px-Tailwind_CSS_Logo.svg.png?20230715030042';
811

912
return (
1013
<>
11-
<div>
14+
<div className="flex justify-center items-center">
1215
<a href="https://vitejs.dev" target="_blank">
1316
<img src={viteLogo} className="logo" alt="Vite logo" />
1417
</a>
1518
<a href="https://react.dev" target="_blank">
1619
<img src={reactLogo} className="logo react" alt="React logo" />
1720
</a>
21+
<a href="https://tailwindcss.com/" target="_blank">
22+
<img
23+
src={tailwindcssSrc}
24+
className="logo tailwind"
25+
alt="Tailwind CSS logo"
26+
/>
27+
</a>
1828
</div>
19-
<h1>Vite + React</h1>
29+
<h1>Vite + React + Tailwind CSS</h1>
2030
<div className="card">
2131
<button onClick={() => setCount((count) => count + 1)}>
2232
count is {count}
@@ -26,10 +36,11 @@ function App() {
2636
</p>
2737
</div>
2838
<p className="read-the-docs">
29-
Click on the Vite and React logos to learn more
39+
Click on the Vite, React, and Tailwind logos to learn more
3040
</p>
41+
<p className="text-red-400 font-bold mt-10">Tailwind is working.</p>
3142
</>
32-
)
43+
);
3344
}
3445

35-
export default App
46+
export default App;

‎src/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
15
:root {
26
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
37
line-height: 1.5;

‎tailwind.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('tailwindcss').Config} */
2+
export default {
3+
content: ['./src/**/*.{js,jsx,ts,tsx}'],
4+
theme: {
5+
extend: {},
6+
},
7+
plugins: [],
8+
};

0 commit comments

Comments
 (0)
Please sign in to comment.