Skip to content

Commit 5e17cc8

Browse files
committedAug 2, 2021
refactor: refactor tailwindcss to windicss
1 parent 02e7756 commit 5e17cc8

File tree

13 files changed

+205
-375
lines changed

13 files changed

+205
-375
lines changed
 

‎.vscode/settings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
"vueuse",
148148
"zxcvbn",
149149
"lintstagedrc",
150-
"brotli"
150+
"brotli",
151+
"tailwindcss",
152+
"sider"
151153
]
152154
}

‎CHANGELOG.zh_CN.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.7.0(2021-08-03)
2+
3+
## (破坏性更新) Breaking changes
4+
5+
- 将项目`tailwindcss`还原回`windicss`,尝试了`tailwindcss`,问题可能还挺多,先切换回`windicss`提高开发效率,切换成本较低。
6+
- 目前项目不兼容地方有
7+
- `xl:!m-4` 之类的写法需要改为`!xl:m-4`,注意只有`!`这个不兼容,没用到则不用改
8+
- 内存溢出问题可能还在(频率低,重启下即可,重启 vite 较快)
9+
110
### ✨ Features
211

312
- **Preview** 添加新的属性及事件

‎build/vite/plugin/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
55
import legacy from '@vitejs/plugin-legacy';
66

77
import purgeIcons from 'vite-plugin-purge-icons';
8-
8+
import windiCSS from 'vite-plugin-windicss';
99
import { configHtmlPlugin } from './html';
1010
import { configPwaConfig } from './pwa';
1111
import { configMockPlugin } from './mock';
@@ -33,6 +33,9 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
3333
vueJsx(),
3434
];
3535

36+
// vite-plugin-windicss
37+
vitePlugins.push(windiCSS());
38+
3639
// TODO
3740
!isBuild && vitePlugins.push(configHmrPlugin());
3841

‎package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"dependencies": {
3737
"@iconify/iconify": "^2.0.3",
38-
"@logicflow/core": "^0.6.5",
39-
"@logicflow/extension": "^0.6.5",
38+
"@logicflow/core": "^0.6.6",
39+
"@logicflow/extension": "^0.6.6",
4040
"@vueuse/core": "^5.2.0",
4141
"@zxcvbn-ts/core": "^1.0.0-beta.0",
4242
"ant-design-vue": "2.2.2",
@@ -67,7 +67,7 @@
6767
"devDependencies": {
6868
"@commitlint/cli": "^13.1.0",
6969
"@commitlint/config-conventional": "^13.1.0",
70-
"@iconify/json": "^1.1.381",
70+
"@iconify/json": "^1.1.382",
7171
"@purge-icons/generated": "^0.7.0",
7272
"@types/codemirror": "^5.60.2",
7373
"@types/crypto-js": "^4.0.2",
@@ -77,13 +77,13 @@
7777
"@types/jest": "^26.0.24",
7878
"@types/lodash-es": "^4.17.4",
7979
"@types/mockjs": "^1.0.4",
80-
"@types/node": "^16.4.9",
80+
"@types/node": "^16.4.10",
8181
"@types/nprogress": "^0.2.0",
8282
"@types/qrcode": "^1.4.1",
8383
"@types/qs": "^6.9.7",
8484
"@types/sortablejs": "^1.10.7",
85-
"@typescript-eslint/eslint-plugin": "^4.28.5",
86-
"@typescript-eslint/parser": "^4.28.5",
85+
"@typescript-eslint/eslint-plugin": "^4.29.0",
86+
"@typescript-eslint/parser": "^4.29.0",
8787
"@vitejs/plugin-legacy": "^1.5.0",
8888
"@vitejs/plugin-vue": "^1.3.0",
8989
"@vitejs/plugin-vue-jsx": "^1.1.7",
@@ -119,20 +119,20 @@
119119
"stylelint-config-prettier": "^8.0.2",
120120
"stylelint-config-standard": "^22.0.0",
121121
"stylelint-order": "^4.1.0",
122-
"tailwindcss": "^2.2.7",
123122
"ts-jest": "^27.0.4",
124123
"ts-node": "^10.1.0",
125124
"typescript": "4.3.5",
126125
"vite": "2.4.4",
127-
"vite-plugin-compression": "^0.3.1",
126+
"vite-plugin-compression": "^0.3.3",
128127
"vite-plugin-html": "^2.0.7",
129-
"vite-plugin-imagemin": "^0.4.1",
130-
"vite-plugin-mock": "^2.9.3",
128+
"vite-plugin-imagemin": "^0.4.3",
129+
"vite-plugin-mock": "^2.9.4",
131130
"vite-plugin-purge-icons": "^0.7.0",
132131
"vite-plugin-pwa": "^0.9.3",
133-
"vite-plugin-style-import": "^1.0.1",
134-
"vite-plugin-svg-icons": "^1.0.1",
132+
"vite-plugin-style-import": "^1.1.0",
133+
"vite-plugin-svg-icons": "^1.0.3",
135134
"vite-plugin-theme": "^0.8.1",
135+
"vite-plugin-windicss": "^1.2.7",
136136
"vue-eslint-parser": "^7.10.0",
137137
"vue-tsc": "^0.2.2"
138138
},

‎postcss.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
plugins: {
3-
tailwindcss: {},
43
autoprefixer: {},
54
},
65
};

‎src/design/tailwind.css

-4
This file was deleted.

‎src/main.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import '/@/design/index.less';
2-
import '/@/design/tailwind.css';
2+
3+
// Register windi
4+
import 'virtual:windi.css';
35
// Register icon sprite
46
import 'virtual:svg-icons-register';
57
import App from './App.vue';

‎src/views/dashboard/analysis/components/GrowCard.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
size="small"
66
:loading="$attrs.loading"
77
:title="item.title"
8-
class="md:w-1/4 w-full md:!mt-0 !mt-4"
9-
:class="[index + 1 < 4 && 'md:!mr-4']"
8+
class="md:w-1/4 w-full !md:mt-0 !mt-4"
9+
:class="[index + 1 < 4 && '!md:mr-4']"
1010
:canExpan="false"
1111
>
1212
<template #extra>

‎src/views/dashboard/analysis/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="md:flex enter-y">
77
<VisitRadar class="md:w-1/3 w-full" :loading="loading" />
88

9-
<VisitSource class="md:w-1/3 md:!mx-4 md:!my-0 !my-4 w-full" :loading="loading" />
9+
<VisitSource class="md:w-1/3 !md:mx-4 !md:my-0 !my-4 w-full" :loading="loading" />
1010
<SalesProductPie class="md:w-1/3 w-full" :loading="loading" />
1111
</div>
1212
</div>

‎src/views/dashboard/workbench/components/ProjectCard.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</template>
66

77
<template v-for="item in items" :key="item">
8-
<CardGrid class="md:!w-1/3 !w-full">
8+
<CardGrid class="!md:w-1/3 !w-full">
99
<span class="flex">
1010
<Icon :icon="item.icon" :color="item.color" size="30" />
1111
<span class="text-lg ml-4">{{ item.title }}</span>

‎src/views/dashboard/workbench/index.vue

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
<QuickNav :loading="loading" class="enter-y" />
1111

1212
<Card class="!my-4 enter-y" :loading="loading">
13-
<img
14-
style="height: 216px"
15-
class="h-20 mx-auto"
16-
src="../../../assets/svg/illustration.svg"
17-
/>
13+
<img class="xl:h-50 h-30 mx-auto" src="../../../assets/svg/illustration.svg" />
1814
</Card>
1915

2016
<SaleRadar :loading="loading" class="enter-y" />

‎src/views/sys/login/LoginForm.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
</Button> -->
5454
</FormItem>
5555
<ARow class="enter-x">
56-
<ACol :xs="24" :md="8">
56+
<ACol :md="8" :xs="24">
5757
<Button block @click="setLoginState(LoginStateEnum.MOBILE)">
5858
{{ t('sys.login.mobileSignInFormTitle') }}
5959
</Button>
6060
</ACol>
61-
<ACol :md="8" :xs="24" class="!my-2 md:!my-0 xs:mx-0 md:mx-2">
61+
<ACol :md="8" :xs="24" class="!my-2 !md:my-0 xs:mx-0 md:mx-2">
6262
<Button block @click="setLoginState(LoginStateEnum.QR_CODE)">
6363
{{ t('sys.login.qrSignInFormTitle') }}
6464
</Button>

‎yarn.lock

+167-344
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.