样式
CSS模块化
/* 编译前 */
.example {
color: red;
}
/* 编译后 */
.example[_v-f3f3eg9] {
color: red;
}目录结构
自定义 element-ui 样式
深度选择器
注意事项
Last updated
/* 编译前 */
.example {
color: red;
}
/* 编译后 */
.example[_v-f3f3eg9] {
color: red;
}Last updated
├── css
│ ├── base.scss # 基础样式
│ ├── theme.scss # 自定义 element-ui 样式和主题样式
│ └── vars.scss # 全局变量@import "./vars";
/* 改变element-ui默认主题变量 */
/*主色*/
$--color-primary: $color-primary;
$--color-success: $color-success;
$--color-warning: $color-warning;
$--color-danger: $color-danger;
$--color-info: $color-info;
$--input-border-color: $border-color;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";.aritle-page{ /* 你的命名空间 */
.el-tag { /* element-ui 元素*/
margin-right: 0px;
}
}<style scoped>
.a /deep/ .b { /* ... */ }
</style>.a[data-v-f3f3eg9] .b { /* ... */ }