清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
/*
* var()接受两个参数,自定义属性名(变量名)、缺省值
* 第一个参数custom-property-name调用变量
* 第二参数可选,指定自定义变量无效时的缺省值。
*/
var() = var( <custom-property-name> [, <any-value> ]? )
/* for example */
/* In the component’s style: */
.component .header {
color: var(--header-color, blue);
}
.component .text {
color: var(--text-color, black);
}
/* In the larger application’s style: */
.component {
--text-color: #080;
/* header-color isn’t set,
and so remains blue,
the fallback value */
}