Skip to content

Commit

Permalink
feat: 支持 tailwindcss & 重构页面样式
Browse files Browse the repository at this point in the history
  • Loading branch information
yulimchen committed Mar 6, 2023
1 parent abb6c18 commit 982f81b
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 93 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"postcss": "^8.4.21",
"postcss-mobile-forever": "^2.3.1",
"prettier": "^2.7.1",
"tailwindcss": "^3.2.7",
"typescript": "~4.7.4",
"unplugin-vue-components": "^0.22.12",
"vite": "^4.1.2",
Expand Down
171 changes: 171 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
// 使用 postcss-mobile-to-multi-displays 做 vw 适配,限制最大宽度,兼容桌面端
"postcss-mobile-forever": {
rootSelector: "#app", // 视图的根选择器名称
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { createApp } from "vue";
import { store } from "@/store";
import { store } from "./store";
// normalize.css
import "normalize.css/normalize.css";
// 全局样式
import "@/styles/index.less";
import "./styles/index.less";
// tailwindcss
import "./styles/tailwind.css";
// svg icon
import "virtual:svg-icons-register";

Expand Down
3 changes: 3 additions & 0 deletions src/styles/tailwind.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

0 comments on commit 982f81b

Please sign in to comment.