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
+23 -9
View File
@@ -1,15 +1,29 @@
@import './var.less';
@import '../dropdown-item/var.less';
:root {
--van-dropdown-menu-height: @dropdown-menu-height;
--van-dropdown-menu-background-color: @dropdown-menu-background-color;
--van-dropdown-menu-box-shadow: @dropdown-menu-box-shadow;
--van-dropdown-menu-title-font-size: @dropdown-menu-title-font-size;
--van-dropdown-menu-title-text-color: @dropdown-menu-title-text-color;
--van-dropdown-menu-title-active-text-color: @dropdown-menu-title-active-text-color;
--van-dropdown-menu-title-disabled-text-color: @dropdown-menu-title-disabled-text-color;
--van-dropdown-menu-title-padding: @dropdown-menu-title-padding;
--van-dropdown-menu-title-line-height: @dropdown-menu-title-line-height;
--van-dropdown-menu-option-active-color: @dropdown-menu-option-active-color;
--van-dropdown-menu-content-max-height: @dropdown-menu-content-max-height;
}
.van-dropdown-menu {
user-select: none;
&__bar {
position: relative;
display: flex;
height: @dropdown-menu-height;
background-color: @dropdown-menu-background-color;
box-shadow: @dropdown-menu-box-shadow;
height: var(--van-dropdown-menu-height);
background-color: var(--van-dropdown-menu-background-color);
box-shadow: var(--van-dropdown-menu-box-shadow);
&--opened {
z-index: @dropdown-item-z-index + 1;
@@ -34,7 +48,7 @@
}
.van-dropdown-menu__title {
color: @dropdown-menu-title-disabled-text-color;
color: var(--van-dropdown-menu-title-disabled-text-color);
}
}
}
@@ -43,10 +57,10 @@
position: relative;
box-sizing: border-box;
max-width: 100%;
padding: @dropdown-menu-title-padding;
color: @dropdown-menu-title-text-color;
font-size: @dropdown-menu-title-font-size;
line-height: @dropdown-menu-title-line-height;
padding: var(--van-dropdown-menu-title-padding);
color: var(--van-dropdown-menu-title-text-color);
font-size: var(--van-dropdown-menu-title-font-size);
line-height: var(--van-dropdown-menu-title-line-height);
&::after {
position: absolute;
@@ -61,7 +75,7 @@
}
&--active {
color: @dropdown-menu-title-active-text-color;
color: var(--van-dropdown-menu-title-active-text-color);
&::after {
border-color: transparent transparent currentColor currentColor;