Skip to content

Commit

Permalink
fix: form、cascader、pagination、table等十余个组件css变量无效(#613
Browse files Browse the repository at this point in the history
  • Loading branch information
kongjing committed Feb 2, 2024
1 parent 30d9449 commit aac7a0f
Show file tree
Hide file tree
Showing 37 changed files with 633 additions and 870 deletions.
1,089 changes: 359 additions & 730 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/vantui/src/button/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
vertical-align: bottom;

&:active:not(&--disabled) {
opacity: @button-active-opacity;
.theme(opacity, '@button-active-opacity');
}

.theme(line-height, '@button-line-height');
Expand Down Expand Up @@ -145,7 +145,7 @@

&__loading-text,
&__icon + &__text:not(:empty) {
margin-left: @padding-base;
.theme(margin-left, '@padding-base');
}

&__icon {
Expand Down
46 changes: 32 additions & 14 deletions packages/vantui/src/cascader/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
border-radius: 4px;
position: absolute;
bottom: -10px;
background-color: @cascader-item-active-color;

.theme(background-color, '@cascader-item-active-color');
}
}
}
Expand All @@ -31,31 +32,41 @@

.van-cascader {
width: 100%;
font-size: @cascader-font-size;
line-height: @cascader-line-height;

.theme(font-size, '@cascader-font-size');

.theme(line-height, '@cascader-line-height');

&__title {
display: flex;
justify-content: center;
align-items: center;
padding: @cascader-title-padding;

.theme(padding, '@cascader-title-padding');

text-align: center;
font-weight: bold;
line-height: @cascader-title-line-height;

.theme(line-height, '@cascader-title-line-height');

color: #1a1a1a;
font-size: @cascader-title-font-size;

.theme(font-size, '@cascader-title-font-size');
}

.van-tabs__titles {
padding: @cascader-tabs-item-padding;
.theme(padding, '@cascader-tabs-item-padding');

background: #ffffff;
}

.van-tabs__titles-item {
flex: initial;
min-width: auto;
width: auto;
padding: @cascader-tabs-item-padding;

.theme(padding, '@cascader-tabs-item-padding');

white-space: nowrap;
}

Expand All @@ -69,19 +80,25 @@
margin: 0;
width: 100%;
// padding-top: @cascader-pane-paddingTop;
// height: @cascader-pane-height;
//
.theme(height, '@cascader-pane-height');

overflow-y: auto;
-webkit-overflow-scrolling: touch;
}

&-item {
display: flex;
align-items: center;
padding: @cascader-item-padding;

.theme(padding, '@cascader-item-padding');

margin: 0;
cursor: pointer;
font-size: @cascader-item-font-size;
color: @cascader-item-color;

.theme(font-size, '@cascader-item-font-size');

.theme(color, '@cascader-item-color');

&.disabled {
opacity: 0.6;
Expand All @@ -90,12 +107,13 @@

&.active {
&:not(.disabled) {
color: @cascader-item-active-color;
.theme(color, '@cascader-item-active-color');
}

.van-cascader-item__icon-check {
visibility: visible;
color: @cascader-item-active-color;

.theme(color, '@cascader-item-active-color');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vantui/src/checkbox/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
user-select: none;

&--horizontal {
margin-right: @padding-sm;
.theme(margin-right, '@padding-sm');
}

&__icon-wrap,
Expand Down
3 changes: 2 additions & 1 deletion packages/vantui/src/circle/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
position: relative;
display: inline-block;
text-align: center;
font-size: @circle-font-color;

.theme(font-size, '@circle-font-color');

&__text {
position: absolute;
Expand Down
11 changes: 7 additions & 4 deletions packages/vantui/src/dialog/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
}

&--round-button {
padding-bottom: @padding-md;
color: @text-color;
.theme(padding-bottom, '@padding-md');

.theme(color, '@text-color');
}

&--left {
Expand All @@ -80,12 +81,14 @@

&__confirm {
border: 0 !important;
color: @dialog-confirm-button-color;

.theme(color, '@dialog-confirm-button-color');
}

&__cancel {
border: 0 !important;
color: @dialog-cancel-button-color;

.theme(color, '@dialog-cancel-button-color');
}

&-bounce-enter {
Expand Down
6 changes: 4 additions & 2 deletions packages/vantui/src/dropdown-item/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

&--up {
top: 0;
z-index: @dropdown-z-index;

.theme(z-index, '@dropdown-z-index');
}

&--down {
bottom: 0;
z-index: @dropdown-z-index;

.theme(z-index, '@dropdown-z-index');
}

&__icon {
Expand Down
12 changes: 8 additions & 4 deletions packages/vantui/src/ellipsis/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
overflow: auto;
white-space: unset;
text-overflow: unset;
font-size: @ellipsis-font-size;
line-height: @ellipsis-line-height;

.theme(font-size, '@ellipsis-font-size');

.theme(line-height, '@ellipsis-line-height');
}

.van-ellipsis-hidden {
Expand All @@ -20,7 +22,9 @@

.van-ellipsis-action {
padding-left: 10px;
color: @ellipsis-primary-color;
font-size: @ellipsis-action-font-size;

.theme(color, '@ellipsis-primary-color');

.theme(font-size, '@ellipsis-action-font-size');
}
}
24 changes: 15 additions & 9 deletions packages/vantui/src/empty/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
align-items: center;
justify-content: center;
box-sizing: border-box;
padding: @empty-padding;

.theme(padding, '@empty-padding');

&__image {
width: @empty-image-size;
height: @empty-image-size;
.theme(width, '@empty-image-size');

.theme(height, '@empty-image-size');

&:empty {
display: none;
Expand All @@ -27,11 +29,15 @@
}

&__description {
margin-top: @empty-description-margin-top;
padding: @empty-description-padding;
color: @empty-description-color;
font-size: @empty-description-font-size;
line-height: @empty-description-line-height;
.theme(margin-top, '@empty-description-margin-top');

.theme(padding, '@empty-description-padding');

.theme(color, '@empty-description-color');

.theme(font-size, '@empty-description-font-size');

.theme(line-height, '@empty-description-line-height');

&:empty {
display: none;
Expand All @@ -43,6 +49,6 @@
}

&__bottom {
margin-top: @empty-bottom-margin-top;
.theme(margin-top, '@empty-bottom-margin-top');
}
}
13 changes: 8 additions & 5 deletions packages/vantui/src/field/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@
background-color: transparent;
border: 0;
resize: none;
font-size: @field-font-size;

.theme(font-size, '@field-font-size');

textarea,
.taro-textarea,
input,
.weui-input {
font-size: @field-font-size;
.theme(font-size, '@field-font-size');
}

input,
Expand Down Expand Up @@ -80,7 +81,8 @@
opacity: 1;
.theme(color, '@field-input-disabled-text-color');

-webkit-text-fill-color: @field-input-disabled-text-color; // 修复input textarea 在disabled情况下文字无法展示的问题
.theme(-webkit-text-fill-color, '@field-input-disabled-text-color');
// 修复input textarea 在disabled情况下文字无法展示的问题
}

&--center {
Expand Down Expand Up @@ -185,9 +187,10 @@

.van-field__placeholder {
pointer-events: none;
color: @field-placeholder-text-color;

.theme(color, '@field-placeholder-text-color');

&--error {
color: @field-error-message-color;
.theme(color, '@field-error-message-color');
}
}
42 changes: 28 additions & 14 deletions packages/vantui/src/form-item/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

/* stylelint-disable-next-line no-descending-specificity */
.vant-form-formItem {
line-height: @form-line-height;
.theme(line-height, '@form-line-height');

height: auto;
display: flex;
overflow: hidden;
margin: 0 @form-space-horizontal;
padding: @form-space-vertical 0;
background-color: @form-background-color;

.theme(background-color, '@form-background-color');

&-bottom-border {
border-bottom: @form-border-bottom;
.theme(border-bottom, '@form-border-bottom');
}

&-wrapper {
background-color: @form-background-color;
.theme(background-color, '@form-background-color');

box-sizing: border-box;
}

Expand All @@ -28,7 +31,7 @@
flex-direction: column;

.vant-form-formItem-controll-item {
margin-top: @form-vertical-controll-margin-top;
.theme(margin-top, '@form-vertical-controll-margin-top');
}

.vant-form-label {
Expand All @@ -37,9 +40,12 @@
}

&-controll {
color: @form-controll-color;
margin-left: @form-controll-margin-left;
font-size: @form-controll-font-size;
.theme(color, '@form-controll-color');

.theme(margin-left, '@form-controll-margin-left');

.theme(font-size, '@form-controll-font-size');

flex: 1;
/* stylelint-disable-next-line no-descending-specificity */
&-item {
Expand All @@ -53,11 +59,15 @@

/* stylelint-disable-next-line no-descending-specificity */
.vant-form-label {
width: @form-label-width;
font-size: @form-label-font-size;
.theme(width, '@form-label-width');

.theme(font-size, '@form-label-font-size');

flex: none;
box-sizing: border-box;
color: @form-label-color;

.theme(color, '@form-label-color');

text-align: left;
word-wrap: break-word;
display: flex;
Expand All @@ -70,15 +80,19 @@
}

.vant-form-message {
font-size: @form-message-font-size;
color: @form-message-color;
.theme(font-size, '@form-message-font-size');

.theme(color, '@form-message-color');

height: 0;
transition: all 0.4s;
visibility: hidden;
}

.vant-form-message-show {
height: 30px;
margin-top: @form-message-margin-top;

.theme(margin-top, '@form-message-margin-top');

visibility: visible;
}
Loading

0 comments on commit aac7a0f

Please sign in to comment.