refactor: 样式文件结构优化,新增重置样式

Former-commit-id: 244309f3ab8375f83df2d69b1b474cab23045b22
This commit is contained in:
haoxr
2023-02-27 22:21:04 +08:00
parent 881c737839
commit 274f683a47
5 changed files with 127 additions and 50 deletions

90
src/styles/reset.scss Normal file
View File

@@ -0,0 +1,90 @@
*,
::before,
::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: currentColor;
}
#app {
width: 100%;
height: 100%;
}
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
-moz-tab-size: 4;
tab-size: 4;
width: 100%;
height: 100%;
box-sizing: border-box;
}
body {
margin: 0;
line-height: inherit;
width: 100%;
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizelegibility;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}
a {
color: inherit;
text-decoration: inherit;
}
img,
svg
{
display: inline-block;
}
svg {
vertical-align: -0.15em; //因icon大小被设置为和字体大小一致而span等标签的下边缘会和字体的基线对齐故需设置一个往下的偏移比例来纠正视觉上的未对齐效果
}
*,
*::before,
*::after {
box-sizing: inherit;
}
a:focus,
a:active {
outline: none;
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
text-decoration: none;
}
div:focus {
outline: none;
}
.clearfix {
&::after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}