From e4d4073ee8019bd2deb6902180c6efdaf306d2aa Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 15 Jan 2018 18:54:26 +0800 Subject: [PATCH] update to 3.1 --- components/button/style/index.less | 22 +- components/button/style/mixin.less | 16 +- components/checkbox/style/mixin.less | 29 +- components/grid/style/index.less | 9 + components/grid/style/mixin.less | 1 + components/input/demo/index.vue | 34 ++ components/input/style/index.less | 6 +- components/input/style/mixin.less | 12 +- components/input/style/search-input.less | 61 +-- components/popover/index.vue | 3 +- components/popover/style/index.less | 99 ++--- components/radio/Group.vue | 18 +- components/radio/demo/radioButton.vue | 4 +- components/radio/demo/size.vue | 4 +- components/radio/style/index.less | 45 +- components/style/color/bezierEasing.less | 2 +- components/style/color/colorPalette.less | 85 ++-- components/style/color/colors.less | 72 ++- components/style/color/tinyColor.less | 2 +- components/style/core/base.less | 486 ++++++++++++++++++--- components/style/core/iconfont.less | 38 +- components/style/core/normalize.less | 447 ------------------- components/style/index.js | 2 +- components/style/mixins/compatibility.less | 27 -- components/style/mixins/iconfont.less | 7 +- components/style/mixins/index.less | 1 - components/style/mixins/motion.less | 11 - components/style/mixins/opacity.less | 8 - components/style/themes/default.less | 176 ++++---- components/style/v2-compatible-reset.js | 1 + components/style/v2-compatible-reset.less | 14 + components/tabs/style/card-style.less | 47 +- components/tabs/style/index.less | 41 +- components/tooltip/style/index.less | 45 +- examples/routes.js | 2 +- 35 files changed, 949 insertions(+), 928 deletions(-) create mode 100644 components/input/demo/index.vue delete mode 100644 components/style/core/normalize.less delete mode 100644 components/style/mixins/opacity.less create mode 100644 components/style/v2-compatible-reset.js create mode 100644 components/style/v2-compatible-reset.less diff --git a/components/button/style/index.less b/components/button/style/index.less index e9b930802..2627c4ecb 100644 --- a/components/button/style/index.less +++ b/components/button/style/index.less @@ -12,6 +12,7 @@ // Button styles // ----------------------------- .@{btn-prefix-cls} { + line-height: @line-height-base; .btn; .btn-default; @@ -127,7 +128,7 @@ // To ensure that a space will be placed between character and `Icon`. > .@{iconfont-css-prefix} + span, > span + .@{iconfont-css-prefix} { - margin-left: 0.5em; + margin-left: 8px; } &-clicked:after { @@ -161,6 +162,15 @@ &-background-ghost&-danger { .button-variant-ghost(@btn-danger-color); } + + &-two-chinese-chars:first-letter { + letter-spacing: .34em; + } + + &-two-chinese-chars > * { + letter-spacing: .34em; + margin-right: -.34em; + } } @keyframes buttonEffect { @@ -173,3 +183,13 @@ border-width: 6px; } } + +a.@{btn-prefix-cls} { + line-height: @btn-height-base - 2px; + &-lg { + line-height: @btn-height-lg - 2px; + } + &-sm { + line-height: @btn-height-sm - 2px; + } +} diff --git a/components/button/style/mixin.less b/components/button/style/mixin.less index c8cfb0910..d4995fe32 100644 --- a/components/button/style/mixin.less +++ b/components/button/style/mixin.less @@ -40,7 +40,7 @@ &:hover, &:focus { - .button-color(@primary-color; @background; @primary-color); + .button-color(@primary-5; @background; @primary-5); } &:active, @@ -56,12 +56,12 @@ &:hover, &:focus { - .button-color(@btn-primary-color; @color; @color;); + .button-color(@btn-primary-color; ~`colorPalette("@{color}", 5)`; ~`colorPalette("@{color}", 5)`); } &:active, &.active { - .button-color(@btn-primary-color; ~`colorPalette("@{color}", 7)`; ~`colorPalette("@{color}", 7)`;); + .button-color(@btn-primary-color; ~`colorPalette("@{color}", 7)`; ~`colorPalette("@{color}", 7)`); } .button-disabled(); @@ -109,7 +109,7 @@ > .@{btnClassName} { position: relative; z-index: 1; - float: left; + &:hover, &:focus, &:active, @@ -139,7 +139,6 @@ // -------------------------------------------------- .btn() { display: inline-block; - margin-bottom: 0; font-weight: @btn-font-weight; text-align: center; touch-action: manipulation; @@ -147,7 +146,6 @@ background-image: none; border: @border-width-base @border-style-base transparent; white-space: nowrap; - line-height: 1.15; // https://github.com/ant-design/ant-design/issues/7070 .button-size(@btn-height-base; @btn-padding-base; @font-size-base; @btn-border-radius-base); user-select: none; transition: all .3s @ease-in-out; @@ -185,7 +183,7 @@ } &-sm { - .button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @btn-border-radius-sm); + .button-size(@btn-height-sm; @btn-padding-sm; @btn-font-size-sm; @btn-border-radius-sm); } } @@ -251,8 +249,6 @@ .@{btnClassName}:not(:first-child):not(:last-child) { border-radius: 0; - padding-left: 8px; - padding-right: 8px; } > .@{btnClassName}:first-child { @@ -260,14 +256,12 @@ &:not(:last-child) { border-bottom-right-radius: 0; border-top-right-radius: 0; - padding-right: 8px; } } > .@{btnClassName}:last-child:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; - padding-left: 8px; } & > & { diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index 7a940f36e..2851d2b68 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -4,13 +4,15 @@ @checkbox-inner-prefix-cls: ~"@{checkbox-prefix-cls}-inner"; // 一般状态 .@{checkbox-prefix-cls} { + .reset-component; white-space: nowrap; cursor: pointer; outline: none; display: inline-block; line-height: 1; position: relative; - vertical-align: text-bottom; + vertical-align: middle; + top: -0.09em; .@{checkbox-prefix-cls}-wrapper:hover &-inner, &:hover &-inner, @@ -72,7 +74,7 @@ left: 0; z-index: 1; cursor: pointer; - .opacity(0); + opacity: 0; top: 0; bottom: 0; right: 0; @@ -148,8 +150,9 @@ } .@{checkbox-prefix-cls}-wrapper { + .reset-component; + line-height: unset; cursor: pointer; - font-size: @font-size-base; display: inline-block; & + & { margin-left: 8px; @@ -163,7 +166,8 @@ } .@{checkbox-prefix-cls}-group { - font-size: @font-size-base; + .reset-component; + display: inline-block; &-item { display: inline-block; margin-right: 8px; @@ -175,23 +179,6 @@ margin-left: 0; } } - - @ie8: \0screen; - - // IE8 hack for https://github.com/ant-design/ant-design/issues/2148 - @media @ie8 { - .@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:before, - .@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:after { - .iconfont-font("\e632"); - font-weight: bold; - font-size: 8px; - border: 0; - color: #fff; - left: 2px; - top: 3px; - position: absolute; - } - } } @keyframes antCheckboxEffect { diff --git a/components/grid/style/index.less b/components/grid/style/index.less index 9671dc96d..ad23d6d96 100644 --- a/components/grid/style/index.less +++ b/components/grid/style/index.less @@ -6,6 +6,7 @@ .@{ant-prefix}-row { .make-row(); display: block; + box-sizing: border-box; } .@{ant-prefix}-row-flex { @@ -105,3 +106,11 @@ @media (min-width: @screen-xl-min) { .make-grid(-xl); } + +// Extra Extra Large grid +// +// Columns, offsets, pushes, and pulls for the full hd device range. + +@media (min-width: @screen-xxl-min) { + .make-grid(-xxl); +} diff --git a/components/grid/style/mixin.less b/components/grid/style/mixin.less index ad6ed9623..fd95df193 100644 --- a/components/grid/style/mixin.less +++ b/components/grid/style/mixin.less @@ -53,6 +53,7 @@ .loop-grid-columns(@index, @class) when (@index > 0) { .@{ant-prefix}-col@{class}-@{index} { display: block; + box-sizing: border-box; width: percentage((@index / @grid-columns)); } .@{ant-prefix}-col@{class}-push-@{index} { diff --git a/components/input/demo/index.vue b/components/input/demo/index.vue new file mode 100644 index 000000000..e8deb705c --- /dev/null +++ b/components/input/demo/index.vue @@ -0,0 +1,34 @@ +