Tailwind - a utility classes
chakra ui - Component Library
0. Shortcut Installation
Extract Here
theMY_TEMPLATE
zip fileTo Execute the template, run the command
npm run start
in the terminal of VS Code.
1. Tailwind CSS Installation
๐ Tailwind CSS using PostCSS
๐ช Step 1:
npm init -y
๐ช Step 2:
npm install -D tailwindcss postcss autoprefixer
npm vite
or
npm install -D tailwindcss postcss autoprefixer vite
๐ช Step 3:
npx tailwindcss init -p
๐ช Step 4: Create a CSS file main.css
or style.css
- Add it to your html file
<link rel="stylesheet" href="main.css">
<script src="https://cdn.tailwindcss.com"></script>
- Paste the below content โฌ๏ธ in your
main.css
file
@tailwind base;
@tailwind components;
@tailwind utilities;
or
// FileName: ๐ index.js
import 'tailwindcss/base.css';
import 'tailwindcss/components.css';
import 'tailwindcss/utilities.css';
๐ช Step 5: In tailwind.config.js
file
- replace
content[]
withcontent["*"]
"*"
๐ฏ or
FileName: tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
๐ช Step 6: In package.json
file
- Add
"start": "vite"
to your scripts
"start": "vite"
๐ช Step 7:
Run npm run start command to start a dev serve
npm run start
or
npm run start -- --host
- For vite server to get host link of network.
2. VS Code Extension - for tailwindcss
Tailwind CSS IntelliSense
- It
enhances
the Tailwind development experience by providing features such asautocomplete, syntax highlighting, and linting.
- It
PostCSS Language Support
- Resolve Error:
โ ๏ธ unknown rule @apply
in css File
- Resolve Error:
Headwind Extension
- Tailwind CSS class sorter for Visual Studio Code. It enforces consistent ordering of classes by parsing your code and reprinting class tags to follow a given order.
Headwind: `Run On Save`
โฌ A flag that controls whether or not Headwind will sort your Tailwind CSS classes on save.
Note: Remain this option as untick.
๐ Tailwind CSS Debug Screens- GitHub Installation Instruction
- A Tailwind CSS component that shows the currently active screen (responsive breakpoint).
๐ Tailwindcss Brand Colors- GitHub Installation Instruction
- Tailwind plugin for adding brands colors as background, border and text colors.
3. Deploying a Tailwind Website to Production : Tailwind Tutorial #13
FileName: package.json
{
"scripts": {
"build": "vite build",
"preview": "vite preview"
}
}
ย