feat(style): add component css variables

This commit is contained in:
chenjiahan
2021-06-12 15:52:22 +08:00
committed by neverland
parent dafea4e1e8
commit fe1cba97b7
73 changed files with 1702 additions and 799 deletions
+21 -9
View File
@@ -1,21 +1,33 @@
@import './var.less';
:root {
--van-index-anchor-z-index: @index-anchor-z-index;
--van-index-anchor-padding: @index-anchor-padding;
--van-index-anchor-text-color: @index-anchor-text-color;
--van-index-anchor-font-weight: @index-anchor-font-weight;
--van-index-anchor-font-size: @index-anchor-font-size;
--van-index-anchor-line-height: @index-anchor-line-height;
--van-index-anchor-background-color: @index-anchor-background-color;
--van-index-anchor-sticky-text-color: @index-anchor-sticky-text-color;
--van-index-anchor-sticky-background-color: @index-anchor-sticky-background-color;
}
.van-index-anchor {
z-index: @index-anchor-z-index;
z-index: var(--van-index-anchor-z-index);
box-sizing: border-box;
padding: @index-anchor-padding;
color: @index-anchor-text-color;
font-weight: @index-anchor-font-weight;
font-size: @index-anchor-font-size;
line-height: @index-anchor-line-height;
background-color: @index-anchor-background-color;
padding: var(--van-index-anchor-padding);
color: var(--van-index-anchor-text-color);
font-weight: var(--van-index-anchor-font-weight);
font-size: var(--van-index-anchor-font-size);
line-height: var(--van-index-anchor-line-height);
background-color: var(--van-index-anchor-background-color);
&--sticky {
position: fixed;
top: 0;
right: 0;
left: 0;
color: @index-anchor-sticky-text-color;
background-color: @index-anchor-sticky-background-color;
color: var(--van-index-anchor-sticky-text-color);
background-color: var(--van-index-anchor-sticky-background-color);
}
}