Vue修改mint-ui默认样式的方法
在使用vue框架开发时,饿了么的mint-ui框架是个不错的选择,但是有时候我们需要修改它的默认样式,方法如下:
1、在src/assets/css目录下新建scss文件,my-mint.scss,内容如下:
/* 覆盖mint-ui的primary颜色,改为自己UI的主题色 */ $color-primary: #05AFAF; .mint-header { background-color: $color-primary; } .mint-button:not(.is-disabled):active::after { opacity: .2 /* .6 */ } .mint-button--primary { background-color: $color-primary; } .mint-button--primary.is-plain { border: 1px solid $color-primary; color: $color-primary } .mint-badge.is-primary { background-color: $color-primary } .mint-switch-input:checked + .mint-switch-core { border-color: $color-primary; background-color: $color-primary; } .mint-navbar .mint-tab-item.is-selected { border-bottom: 3px solid $color-primary; color: $color-primary; } .mint-tabbar > .mint-tab-item.is-selected { color: $color-primary; } .mint-searchbar-cancel { color: $color-primary; } .mint-checkbox-input:checked + .mint-checkbox-core { background-color: $color-primary; border-color: $color-primary; } .mint-radio-input:checked + .mint-radio-core { background-color: $color-primary; border-color: $color-primary; } .mt-range-progress { background-color: $color-primary; } .mt-progress-progress { background-color: $color-primary; } .mint-msgbox-confirm { color: $color-primary; } .mint-msgbox-confirm:active { color: $color-primary; } .mint-datetime-action { color: $color-primary; }
2、在main.js中引入自定义的scss文件
import './assets/css/my-mint.scss';//全局修改mint-UI样式
相关推荐
Ladyseven 2020-10-22
luofuIT成长记录 2020-09-22
Mynamezhuang 2020-09-18
李鴻耀 2020-08-17
yaodilu 2020-08-03
zhoujiyu 2020-06-28
89510194 2020-06-27
CaiKanXP 2020-06-13
MaureenChen 2020-06-12
Phoebe的学习天地 2020-06-07
淡风wisdon大大 2020-06-06
buttonChan 2020-06-06
xtuhcy 2020-05-20
AlisaClass 2020-05-18
赵家小少爷 2020-05-16
nicepainkiller 2020-05-05