一些常用样式的设置
一、一行或者多行文本显示省略号
// 一行或者多行文本显示省略号
.omitCommon {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.doubleOmit {
.omitCommon;
-webkit-line-clamp: 2;
}
二、ant design-form表单去掉必填项前面的星号*及后面的冒号
.special_form {
.ant-form-item-label > label::after {
content: '';
position: relative;
top: -0.5px;
margin: 0 10px 0 0;
}
.ant-form-item-label
> label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before {
display: none;
}
}
三、flex
.flex {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flex-v {
-webkit-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.flex-1 {
-webkit-box-flex: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
}
.flex-2 {
-webkit-box-flex: 2;
-webkit-flex: 2;
-ms-flex: 2;
flex: 2;
}
.flex-align-center {
-webkit-box-align: center;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.flex-pack-center {
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.flex-pack-justify {
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
四、底部固定的Footer
.Footer {
position: fixed;
bottom: 0;
left: 207px;
display: flex;
background: #fff;
justify-content: center;
align-items: center;
box-shadow: 0px -4px 10px 0px rgba(187, 189, 202, 0.19);
height: 64px;
line-height: 64px;
z-index: 100;
&.unfold {
// 左侧侧边栏未折叠时
left: 80px;
width: calc(100% - 80px);
}
&.fold {
// 左侧侧边栏折叠时
left: 207px;
width: calc(100% - 207px);
}
button {
width: 80px;
height: 32px;
font-size: 12px;
&:nth-last-of-type(2) {
margin-right: 30px;
}
}
}
五、文本内换行(需要单独设置合适的宽度)
.special_wrap {
white-space: pre-line;
display: inline-flex;
word-break: break-all;
}
六、重置样式
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}
body {
line-height: 1;
overflow: hidden;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
html,
body {
height: 100%;
width: 100%;
background-color: #f5f5f5;
overflow: hidden;
}
#root {
width: 100%;
height: 100%;
box-sizing: border-box;
}