refactor: 简化unocss集成

This commit is contained in:
张传龙
2022-06-11 16:55:36 +08:00
parent b5ac614943
commit 67d966e096
10 changed files with 290 additions and 145 deletions

View File

@@ -18,6 +18,7 @@
<n-layout style="background-color: #f5f6fb" :style="`height: calc(100% - ${useTheme.header.height}px)`">
<AppTags v-if="useTheme.tags.visible" />
<AppMain
class="cur-scroll"
:style="{
height: `calc(100% - ${useTheme.tags.visible ? useTheme.tags.height : 0}px)`,
overflow: 'auto',

View File

@@ -1,3 +1,4 @@
import '@/styles/reset.css'
import '@/styles/index.scss'
import 'uno.css'

View File

@@ -1,2 +1,54 @@
@import './reset.scss';
@import './public.scss';
html {
font-size: 4px; // * 1rem = 4px 方便unocss计算在unocss中 1字体单位 = 0.25rem,相当于 1等份 = 1px
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #f2f2f2;
font-family: 'Encode Sans Condensed', sans-serif;
}
/* router view transition fade-slide */
.fade-slide-leave-active,
.fade-slide-enter-active {
transition: all 0.3s;
}
.fade-slide-enter-from {
opacity: 0;
transform: translateX(-30px);
}
.fade-slide-leave-to {
opacity: 0;
transform: translateX(30px);
}
/* 自定义滚动条样式 */
.cur-scroll {
&::-webkit-scrollbar{
width:8px;
height:8px;
}
&::-webkit-scrollbar-thumb{
background-color: transparent;
border-radius:4px;
}
&::-webkit-scrollbar-corner{
background: #f6f6f6;
}
&:hover {
&::-webkit-scrollbar-thumb {
background: #bfbfbf;
}
&::-webkit-scrollbar-thumb:hover{
background: #999999;
}
}
}

View File

@@ -1,42 +0,0 @@
html {
font-size: 4px; // * 1rem = 4px 方便unocss计算在unocss中 1字体单位 = 0.25rem,相当于 1等份 = 1px
}
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #f2f2f2;
font-family: 'Encode Sans Condensed', sans-serif;
}
/* router view transition fade-slide */
.fade-slide-leave-active,
.fade-slide-enter-active {
transition: all 0.3s;
}
.fade-slide-enter-from {
opacity: 0;
transform: translateX(-30px);
}
.fade-slide-leave-to {
opacity: 0;
transform: translateX(30px);
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 8px;
background-color: #eee;
}
::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
&:hover {
background-color: #a8a8a8;
}
}