例如希望能 height: line-height;
或 height: var(line-height);
,并自动保持动态映射,不需要 JS 介入?
(补充:我知道自定义变量怎么获取,我是想引用原生属性,就像 JS 中的 getComputedStyle
那样)
你自己不都说出来了嘛。。。不过兼容性稍微可能差点。
:root {
--global-line-height: 20px;
}
.xx {
height: var(--global-line-height);
}