Skip to content

Commit 4249465

Browse files
committed
wip: use unocss
1 parent 8e78975 commit 4249465

File tree

25 files changed

+295
-251
lines changed

25 files changed

+295
-251
lines changed

build/vite/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { resolve } from 'path'
22
import Vue from '@vitejs/plugin-vue'
33
import VueJsx from '@vitejs/plugin-vue-jsx'
4-
import WindiCSS from 'vite-plugin-windicss'
54
import progress from 'vite-plugin-progress'
65
import EslintPlugin from 'vite-plugin-eslint'
76
import PurgeIcons from 'vite-plugin-purge-icons'
@@ -15,6 +14,7 @@ import viteCompression from 'vite-plugin-compression'
1514
import topLevelAwait from 'vite-plugin-top-level-await'
1615
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
1716
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
17+
import UnoCSS from 'unocss/vite'
1818

1919
export function createVitePlugins() {
2020
const root = process.cwd()
@@ -27,7 +27,7 @@ export function createVitePlugins() {
2727
return [
2828
Vue(),
2929
VueJsx(),
30-
WindiCSS(),
30+
UnoCSS(),
3131
progress(),
3232
PurgeIcons(),
3333
ElementPlus({}),

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@
8787
"@types/qs": "^6.9.7",
8888
"@typescript-eslint/eslint-plugin": "^6.2.0",
8989
"@typescript-eslint/parser": "^6.2.0",
90+
"@unocss/transformer-variant-group": "^0.51.4",
9091
"@vitejs/plugin-legacy": "^4.1.1",
9192
"@vitejs/plugin-vue": "^4.2.3",
9293
"@vitejs/plugin-vue-jsx": "^3.0.1",
94+
"@vue-macros/volar": "^0.12.3",
9395
"autoprefixer": "^10.4.14",
9496
"bpmn-js": "^8.9.0",
9597
"bpmn-js-properties-panel": "^0.46.0",
@@ -114,6 +116,7 @@
114116
"stylelint-order": "^6.0.3",
115117
"terser": "^5.19.2",
116118
"typescript": "5.1.6",
119+
"unocss": "^0.54.0",
117120
"unplugin-auto-import": "^0.16.6",
118121
"unplugin-element-plus": "^0.7.2",
119122
"unplugin-vue-components": "^0.25.1",
@@ -125,9 +128,7 @@
125128
"vite-plugin-purge-icons": "^0.9.2",
126129
"vite-plugin-svg-icons": "^2.0.1",
127130
"vite-plugin-top-level-await": "^1.3.1",
128-
"vite-plugin-windicss": "^1.9.0",
129-
"vue-tsc": "^1.8.8",
130-
"windicss": "^3.5.6"
131+
"vue-tsc": "^1.8.8"
131132
},
132133
"license": "MIT",
133134
"repository": {

src/components/ContentDetailWrap/src/ContentDetailWrap.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ onMounted(() => {
2828
<div
2929
:class="[
3030
`${prefixCls}-header`,
31-
'flex border-bottom-1 h-50px items-center text-center pr-10px'
31+
'lex b-b-1 h-50px items-center text-center bg-white pr-10px'
3232
]"
3333
>
3434
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">

src/components/Descriptions/src/Descriptions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ const toggleClick = () => {
7171
<div
7272
:class="[
7373
prefixCls,
74-
'bg-[var(--el-color-white)] dark:(bg-[var(--el-bg-color)] border-[var(--el-border-color)] border-1px)'
74+
'bg-[var(--el-color-white)] dark:bg-[var(--el-bg-color)] dark:border-[var(--el-border-color)] dark:border-1px'
7575
]"
7676
>
7777
<div
7878
v-if="title"
7979
:class="[
8080
`${prefixCls}-header`,
81-
'h-50px flex justify-between items-center border-bottom-1 border-solid border-[var(--tags-view-border-color)] px-10px cursor-pointer dark:border-[var(--el-border-color)]'
81+
'h-50px flex justify-between items-center b-b-1 border-solid border-[var(--el-border-color)] px-10px cursor-pointer dark:border-[var(--el-border-color)]'
8282
]"
8383
@click="toggleClick"
8484
>

src/components/Dialog/src/Dialog.vue

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,28 +99,24 @@ const dialogStyle = computed(() => {
9999
</template>
100100

101101
<style lang="scss">
102-
.#{$elNamespace}-dialog__header {
103-
margin-right: 0 !important;
104-
border-bottom: 1px solid var(--tags-view-border-color);
105-
}
102+
.#{$elNamespace}-dialog {
103+
&__header {
104+
margin-right: 0 !important;
105+
border-bottom: 1px solid var(--el-border-color);
106+
}
106107
107-
.#{$elNamespace}-dialog__footer {
108-
border-top: 1px solid var(--tags-view-border-color);
108+
&__body {
109+
padding: 0 !important;
110+
}
111+
112+
&__footer {
113+
border-top: 1px solid var(--el-border-color);
114+
}
109115
}
110116
111117
.is-hover {
112118
&:hover {
113119
color: var(--el-color-primary) !important;
114120
}
115121
}
116-
117-
.dark {
118-
.#{$elNamespace}-dialog__header {
119-
border-bottom: 1px solid var(--el-border-color);
120-
}
121-
122-
.#{$elNamespace}-dialog__footer {
123-
border-top: 1px solid var(--el-border-color);
124-
}
125-
}
126122
</style>

src/components/Editor/src/Editor.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ const handleChange = (editor: IDomEditor) => {
164164
// 组件销毁时,及时销毁编辑器
165165
onBeforeUnmount(() => {
166166
const editor = unref(editorRef.value)
167-
if (editor === null) return
168167
169168
// 销毁,并移除 editor
170169
editor?.destroy()
@@ -181,12 +180,12 @@ defineExpose({
181180
</script>
182181

183182
<template>
184-
<div class="border-1 border-solid border-[var(--tags-view-border-color)] z-99">
183+
<div class="border-1 border-solid border-[var(--el-border-color)] z-99">
185184
<!-- 工具栏 -->
186185
<Toolbar
187186
:editor="editorRef"
188187
:editorId="editorId"
189-
class="border-bottom-1 border-solid border-[var(--tags-view-border-color)]"
188+
class="border-0 b-b-1 border-solid border-[var(--el-border-color)]"
190189
/>
191190
<!-- 编辑器 -->
192191
<Editor

src/layout/components/AppView.vue

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,33 @@ const tagsViewStore = useTagsViewStore()
1818
const getCaches = computed((): string[] => {
1919
return tagsViewStore.getCachedViews
2020
})
21+
22+
const tagsView = computed(() => appStore.getTagsView)
2123
</script>
2224

2325
<template>
2426
<section
2527
:class="[
26-
'p-[var(--app-content-padding)] w-[100%] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]',
28+
'p-[var(--app-content-padding)] w-[calc(100%-var(--app-content-padding)-var(--app-content-padding))] bg-[var(--app-content-bg-color)] dark:bg-[var(--el-bg-color)]',
2729
{
28-
'!min-h-[calc(100%-var(--app-footer-height))]':
29-
((fixedHeader && (layout === 'classic' || layout === 'topLeft')) || layout === 'top') &&
30-
footer,
31-
32-
'!min-h-[calc(100%-var(--tags-view-height)-var(--top-tool-height)-var(--app-footer-height))]':
30+
'!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]':
31+
(fixedHeader &&
32+
(layout === 'classic' || layout === 'topLeft' || layout === 'top') &&
33+
footer) ||
34+
(!tagsView && layout === 'top' && footer),
35+
'!min-h-[calc(100%-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height)-var(--tags-view-height))]':
36+
tagsView && layout === 'top' && footer,
37+
38+
'!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--top-tool-height)-var(--app-footer-height))]':
3339
!fixedHeader && layout === 'classic' && footer,
3440
35-
'!min-h-[calc(100%-var(--tags-view-height)-var(--app-footer-height))]':
36-
!fixedHeader && (layout === 'topLeft' || layout === 'top') && footer,
41+
'!min-h-[calc(100%-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-var(--app-footer-height))]':
42+
!fixedHeader && layout === 'topLeft' && footer,
3743
38-
'!min-h-[calc(100%-var(--top-tool-height))]': fixedHeader && layout === 'cutMenu' && footer,
44+
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding))]':
45+
fixedHeader && layout === 'cutMenu' && footer,
3946
40-
'!min-h-[calc(100%-var(--top-tool-height)-var(--tags-view-height))]':
47+
'!min-h-[calc(100%-var(--top-tool-height)-var(--app-content-padding)-var(--app-content-padding)-var(--tags-view-height))]':
4148
!fixedHeader && layout === 'cutMenu' && footer
4249
}
4350
]"

src/layout/components/LocaleDropdown/src/LocaleDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const setLang = (lang: LocaleType) => {
3838
:class="$attrs.class"
3939
:color="color"
4040
:size="18"
41-
class="cursor-pointer"
41+
class="cursor-pointer !p-0"
4242
icon="ion:language-sharp"
4343
/>
4444
<template #dropdown>

src/layout/components/Logo/src/Logo.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ watch(
6262
:class="[
6363
prefixCls,
6464
layout !== 'classic' ? `${prefixCls}__Top` : '',
65-
'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative',
66-
'dark:bg-[var(--el-bg-color)]'
65+
'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative decoration-none overflow-hidden'
6766
]"
6867
to="/"
6968
>

src/layout/components/Menu/src/Menu.vue

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,6 @@ $prefix-cls: #{$namespace}-menu;
138138
position: relative;
139139
transition: width var(--transition-time-02);
140140
141-
&:after {
142-
position: absolute;
143-
top: 0;
144-
right: 0;
145-
height: 100%;
146-
border-left: 1px solid var(--left-menu-border-color);
147-
content: '';
148-
}
149-
150141
:deep(.#{$elNamespace}-menu) {
151142
width: 100% !important;
152143
border-right: none;

0 commit comments

Comments
 (0)