Parcel——2,引入TailwindCss

1,搭建Parcel工程

参考:https://blog.csdn.net/qq_37284843/article/details/123752053

2,搭建TailwindCss

根目录新建配置文件:

.postcssrc

{
    
    
  "plugins": {
    
    
	"tailwindcss": {
    
    }
  }
}

tailwind.config.js

module.exports = {
    
    
	content: [
		"./src/**/*.{html,js,ts,jsx,tsx}",
	],
	theme: {
    
    
		extend: {
    
    },
	},
	plugins: [],
}

新建一个index.css,引入基础的类。

@tailwind base;
@tailwind components;
@tailwind utilities;

在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>

效果:

在这里插入图片描述

3,小总结

  1. .postcssrc
  2. tailwind.config.js
  3. index.css

快是真的快。

猜你喜欢

转载自blog.csdn.net/qq_37284843/article/details/123768900