-
Notifications
You must be signed in to change notification settings - Fork 323
Closed
Labels
questionThis is a question, not a bugThis is a question, not a bug
Description
建议:
使用css3的变量函数 var(--) 来自定义。
以Button按钮组件为例子:
开发者如果想自定义背景色(background-color)、字体色(color)、边框(border)
现阶段是样式覆盖,经测试需要加 !important 才能覆盖以上样式,个人感觉写法有点不爽
如果使用css3的变量函数 var(--) ,按照以下写法,个人感觉合理,希望能被采纳
组件内部写法 :
.t-button{
color: var(--color , #000000e6);
background-color: var(--background-color , #fff);
border: var(--border , 1px solid #dcdcdc);
}
组件外部自定义时:
.my-button{
--color : red;
--background-color : blue
--border : solid 5px yellow
}
vhxubo and amberlwan
Metadata
Metadata
Assignees
Labels
questionThis is a question, not a bugThis is a question, not a bug