element-ui 默认样式文件

4 阅读2分钟

项目标签默认样式修改 .css

@charset "utf-8";
a,
abbr,
acronym,
address,
applet,
article,
aside,
audio,
b,
big,
blockquote,
body,
canvas,
caption,
center,
cite,
code,
dd,
del,
details,
dfn,
div,
dl,
dt,
em,
embed,
fieldset,
figcaption,
figure,
footer,
form,
h1,
h2,
h3,
h4,
h5,
h6,
header,
hgroup,
html,
i,
iframe,
img,
input,
ins,
kbd,
label,
legend,
li,
mark,
menu,
nav,
object,
ol,
output,
p,
pre,
q,
ruby,
s,
samp,
section,
small,
span,
strike,
strong,
sub,
summary,
sup,
table,
tbody,
td,
tfoot,
th,
thead,
time,
tr,
tt,
u,
ul,
var,
video {
    margin: 0;
    padding: 0
}
img {border: 0;vertical-align: middle;}
em,i {font-style: normal;}
ins {text-decoration: none;}
dd,dl,dt,li,ol,ul {list-style: none;}
button,input,select,textarea {outline: 0;}
textarea {resize: none;}
a:focus, a:active { outline: none; }
a, a:focus, a:hover { cursor: pointer; color: inherit; text-decoration: none; }
table {border-collapse: collapse;border-spacing: 0;}

项目ElementUI样式默认修改 .css

// ElementUI表格show-overflow-tooltip设置宽度
.el-tooltip__popper {
  max-width: 50%;
}
// 下拉框列表项字段名称过长时省略处理
// <el-select popper-class="selectBox" v-model="taskId" change="handleChange">
.selectBox .el-scrollbar .el-select-dropdown__item>span {
  max-width: 500px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 分页列表-检索项查询的input,select,datePicker默认宽度
// <div class='app-container'>
//   <el-form :model="queryParams" ref="queryForm" size="small" inline label-width="110px">
//     <el-input> <el-select> <<el-date-picker>
.app-container{
  .el-form.el-form--inline {
    .el-form-item.el-form-item--small {
      .el-input.el-input--small {
        width: 250px;
      }
      .el-select.el-select--small {
        width: 250px;
      }
      .el-date-editor.el-range-editor--small {
        width: 250px;
        .el-range-input{
          font-size:14px;
        }
      }
    }
  }
}

项目通用css样式布局处理

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: Microsoft YaHei, Arial, sans-serif;
  height: 100%;
}
html {
  height: 100%;
  box-sizing: border-box;
}
#app {
  height: 100%;
}
.fr {
  float: right;
}
.fl {
  float: left;
}
.pointer {
  cursor: pointer;
}
.elips {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}
.clearfix {
  &:after {
    visibility: hidden;
    display: block;
    font-size: 0;
    content: " ";
    clear: both;
    height: 0;
  }
}
.font12 { 
    font-size: 12px
}
.font14 {
    font-size: 14px
}
.font16 {
    font-size: 16px
}
 /** 基础通用 **/
.p0{
  padding: 0px !important;
}
.pt5 {
	padding-top: 5px;
}
.pr5 {
	padding-right: 5px;
}
.pb5 {
	padding-bottom: 5px;
}
.mt5 {
	margin-top: 5px;
}
.mr5 {
	margin-right: 5px;
}
.mb5 {
	margin-bottom: 5px;
}
.mb8 {
	margin-bottom: 8px;
}
.ml5 {
	margin-left: 5px;
}
.mt10 {
	margin-top: 10px;
}
.mr10 {
	margin-right: 10px;
}
.mb10 {
	margin-bottom: 10px;
}
.ml10 {
	margin-left: 10px;
}
.mt20 {
	margin-top: 20px;
}
.mr20 {
	margin-right: 20px;
}
.mb20 {
	margin-bottom: 20px;
}
.ml20 {
	margin-left: 20px;
}
.ml80{
  margin-left: 80px;
}
.mt80{
  margin-top: 80px;
} 
.mb80{
  margin-bottom: 80px;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
	font-family: inherit;
	font-weight: 500;
	line-height: 1.1;
	color: inherit;
}
/* image */
.img-circle {
	border-radius: 50%;
}

/* text color */
.text-navy {
	color: #1ab394;
}

.text-primary {
	color: inherit;
}

.text-success {
	color: #1c84c6;
}

.text-info {
	color: #23c6c8;
}

.text-warning {
	color: #f8ac59;
}

.text-danger {
	color: #ed5565;
}

.text-muted {
	color: #888888;
}