Article directory
1. Build Parcel project
Reference: https://blog.csdn.net/qq_37284843/article/details/123752053
2. Build TailwindCss
Create a new configuration file in the root directory:
.postcssrc
{
"plugins": {
"tailwindcss": {
}
}
}
tailwind.config.js
module.exports = {
content: [
"./src/**/*.{html,js,ts,jsx,tsx}",
],
theme: {
extend: {
},
},
plugins: [],
}
Create a new index.css and introduce the basic classes.
@tailwind base;
@tailwind components;
@tailwind utilities;
Introduce it in html.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link href="./index.css" rel="stylesheet"/>
</head>
<body>
<h1 class="underline">这段文字有下划线</h1>
</body>
</html>
Effect:
3. Small summary
- .postcssrc
- tailwind.config.js
- index.css
Fast is really fast.