From 7e0a6ffc36788a8b9fa71867a2a2be88abcae180 Mon Sep 17 00:00:00 2001 From: James Yeung Date: Mon, 9 Mar 2020 00:09:32 +0800 Subject: [PATCH] chore: sync ant-design v4.0.2 (#4) --- components/carousel/style/index.less | 2 +- components/date-picker/style/index.less | 1 + components/form/style/index.less | 4 ++-- components/input/style/mixin.less | 2 +- components/input/style/search-input.less | 5 +++++ components/menu/style/index.less | 12 ++++++++++++ components/select/style/multiple.less | 1 - components/select/style/single.less | 6 ++++++ components/style/mixins/clearfix.less | 3 ++- components/style/themes/default.less | 3 ++- components/table/style/index.less | 5 ----- 11 files changed, 32 insertions(+), 12 deletions(-) diff --git a/components/carousel/style/index.less b/components/carousel/style/index.less index 9a422d49..ea619288 100644 --- a/components/carousel/style/index.less +++ b/components/carousel/style/index.less @@ -181,7 +181,7 @@ justify-content: center; margin-right: 15%; margin-left: 15%; - padding-right: 0; + padding-left: 0; list-style: none; .@{carousel-prefix-cls}-rtl& { diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index 80a55310..ee17a7ee 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -148,6 +148,7 @@ font-size: @font-size-lg; line-height: @font-size-lg; text-align: center; + cursor: default; .@{picker-prefix-cls}-rtl & { transform: rotate(180deg); diff --git a/components/form/style/index.less b/components/form/style/index.less index 80267465..a67eb8c6 100644 --- a/components/form/style/index.less +++ b/components/form/style/index.less @@ -13,6 +13,7 @@ @form-prefix-cls: ~'@{ant-prefix}-form'; @form-item-prefix-cls: ~'@{form-prefix-cls}-item'; @form-font-height: ceil(@font-size-base * @line-height-base); +@form-item-label-height: @input-height-base; .@{form-prefix-cls} { .reset-component; @@ -87,8 +88,7 @@ // display: inline; display: inline-flex; align-items: center; - height: 100%; - height: @input-height-base; + height: @form-item-label-height; color: @label-color; font-size: @form-item-label-font-size; diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index da096915..110e509f 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -26,7 +26,7 @@ } border-right-width: @border-width-base !important; outline: 0; - box-shadow: @input-outline-offset @outline-blur-size @outline-width fade(@color, 20%); + box-shadow: @input-outline-offset @outline-blur-size @outline-width fade(@color, @outline-fade); .@{input-rtl-cls} & { border-right-width: 0; diff --git a/components/input/style/search-input.less b/components/input/style/search-input.less index 90d588db..327a862a 100644 --- a/components/input/style/search-input.less +++ b/components/input/style/search-input.less @@ -27,6 +27,11 @@ border: @border-width-base @border-style-base @input-border-color; border-left: 0; } + + &:hover, + &:focus { + border-color: @input-hover-border-color; + } } &.@{ant-prefix}-input-affix-wrapper { diff --git a/components/menu/style/index.less b/components/menu/style/index.less index 2c9b9e3c..5374dfaf 100644 --- a/components/menu/style/index.less +++ b/components/menu/style/index.less @@ -148,7 +148,9 @@ &-vertical-left&-sub, &-vertical-right&-sub { min-width: 160px; + max-height: 100vh; padding: 0; + overflow: auto; border-right: 0; transform-origin: 0 0; @@ -203,6 +205,16 @@ margin-left: 10px; } } + + &.@{menu-prefix-cls}-item-only-child { + .@{iconfont-css-prefix} { + margin-right: 0; + + .@{menu-prefix-cls}-rtl & { + margin-left: 0; + } + } + } } & > &-item-divider { diff --git a/components/select/style/multiple.less b/components/select/style/multiple.less index 78ee0525..a918829b 100644 --- a/components/select/style/multiple.less +++ b/components/select/style/multiple.less @@ -74,7 +74,6 @@ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - transform: translateY(-1px); .@{select-prefix-cls}-rtl& { margin-right: 0; diff --git a/components/select/style/single.less b/components/select/style/single.less index 9fd3ce98..30d1773e 100644 --- a/components/select/style/single.less +++ b/components/select/style/single.less @@ -37,8 +37,14 @@ } } + // For common baseline align &::after, + // For '' value baseline align + .@{select-prefix-cls}-selection-item::after, + // For undefined value baseline align .@{select-prefix-cls}-selection-placeholder::after { + display: inline-block; + width: 0; content: '\a0'; } } diff --git a/components/style/mixins/clearfix.less b/components/style/mixins/clearfix.less index fb81664b..0ed35f9c 100644 --- a/components/style/mixins/clearfix.less +++ b/components/style/mixins/clearfix.less @@ -7,7 +7,8 @@ content: ''; } &::after { - display: block; + // https://github.com/ant-design/ant-design/issues/21864 + display: table; clear: both; content: ''; } diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 973278e0..8c6d6e19 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -126,6 +126,7 @@ @outline-blur-size: 0; @outline-width: 2px; @outline-color: @primary-color; +@outline-fade: 20%; @background-color-light: hsv(0, 0, 98%); // background of header and selected item @background-color-base: hsv(0, 0, 96%); // Default grey background color @@ -512,7 +513,7 @@ @table-border-radius-base: @border-radius-base; @table-footer-bg: @background-color-light; @table-footer-color: @heading-color; -@table-header-bg-sm: @table-bg; +@table-header-bg-sm: @table-header-bg; // Sorter // Legacy: `table-header-sort-active-bg` is used for hover not real active @table-header-sort-active-bg: darken(@table-header-bg, 3%); diff --git a/components/table/style/index.less b/components/table/style/index.less index 2c151256..74fc8579 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -589,11 +589,6 @@ box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%); } } - - // Fix for chrome overflow show the scrollbar - &:not(&-fixed-header) &-content { - overflow-y: hidden; - } } @media all and (-ms-high-contrast: none) {