From d230cedca5780c19baa1e1b02175b16e70688be7 Mon Sep 17 00:00:00 2001 From: ShanaMaid Date: Thu, 23 Aug 2018 18:19:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(less):=20=E5=BC=80=E5=90=AFless=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .stylelintrc | 9 +++++++- components/Alert/style/index.less | 16 +++++++++------ components/Alert/style/var.less | 4 ++-- components/AutoComplete/style/index.less | 7 ++++--- components/AutoComplete/style/var.less | 2 +- components/Avatar/style/index.less | 10 +++++---- components/Avatar/style/var.less | 4 ++-- components/BackTop/style/index.less | 7 ++++--- components/BackTop/style/var.less | 3 ++- components/Badge/style/index.less | 6 +++--- components/Badge/style/var.less | 2 +- components/Breadcrumb/style/index.less | 4 ++-- components/Breadcrumb/style/var.less | 4 ++-- components/Button/style/index.less | 26 +++++++++++++++--------- components/Button/style/var.less | 7 +++---- components/Card/style/index.less | 9 ++++---- components/Card/style/var.less | 4 ++-- components/Carousel/style/index.less | 18 ++++++++-------- components/Carousel/style/var.less | 4 ---- components/Checkbox/style/index.less | 7 +++---- components/Checkbox/style/var.less | 4 ++-- components/Collapse/style/index.less | 3 ++- components/Collapse/style/var.less | 5 ++--- components/Divider/style/index.less | 2 +- components/Divider/style/var.less | 4 +++- components/Drawer/style/index.less | 1 + components/Drawer/style/var.less | 1 - components/Helpers/style/index.less | 2 +- components/Helpers/style/var.less | 2 +- components/Icon/style/index.less | 2 +- components/Icon/style/var.less | 4 ++-- components/Input/style/index.less | 7 ++----- components/Input/style/var.less | 4 ++-- components/InputNumber/style/index.less | 9 ++++---- components/InputNumber/style/var.less | 6 +++--- components/Loading/style/index.less | 1 + components/Loading/style/var.less | 5 ++--- components/Menu/style/index.less | 14 ++++++------- components/Menu/style/var.less | 2 +- components/Message/style/index.less | 2 +- components/Modal/style/index.less | 5 +++-- components/Modal/style/var.less | 2 +- components/Notification/style/index.less | 2 +- components/Notification/style/var.less | 2 +- components/Pagination/style/index.less | 1 + components/Pagination/style/var.less | 4 ++-- components/Pop/style/index.less | 2 +- components/Pop/style/var.less | 6 ++++-- components/Progress/style/index.less | 3 ++- components/Progress/style/var.less | 4 ++-- components/Radio/style/index.less | 7 +++---- components/Radio/style/var.less | 5 ++--- components/Rate/style/index.less | 2 +- components/Rate/style/var.less | 4 ++-- components/Ripple/style/index.less | 1 + components/Ripple/style/var.less | 4 ++-- components/Select/style/index.less | 16 ++++++--------- components/Select/style/var.less | 3 --- components/Slider/style/index.less | 7 ++++--- components/Slider/style/var.less | 4 ++-- components/Steps/style/index.less | 23 ++++++++++++--------- components/Steps/style/var.less | 4 ++-- components/Switch/style/index.less | 2 ++ components/Switch/style/var.less | 4 ++-- components/Table/style/index.less | 3 +-- components/Table/style/var.less | 2 +- components/Tabs/style/card.less | 6 +++--- components/Tabs/style/horizontal.less | 2 +- components/Tabs/style/index.less | 4 ++-- components/Tabs/style/panel.less | 2 +- components/Tabs/style/var.less | 2 +- components/Tabs/style/vertical.less | 2 +- components/Tag/style/index.less | 2 +- components/Tag/style/var.less | 4 ++-- components/Timeline/style/index.less | 19 +++++++++-------- components/Timeline/style/var.less | 4 ++-- components/Tooltip/style/index.less | 16 +++++++-------- components/Tooltip/style/var.less | 4 ++-- components/Transitions/style/index.less | 3 ++- components/Transitions/style/var.less | 2 +- components/styles/common/reset.less | 6 ++++-- components/styles/var.less | 18 ++++++---------- package.json | 10 ++++----- scripts/new-component.js | 1 + 84 files changed, 238 insertions(+), 224 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index f97c154..adc78a5 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,4 +1,11 @@ { + "extends": [ + "stylelint-config-standard" + ], "rules": { - } + "block-no-empty": null, + "no-duplicate-selectors": null, + "unit-blacklist": ["rem"], + "unit-whitelist": ["px", "em", "deg", "%", "s"], + }, } \ No newline at end of file diff --git a/components/Alert/style/index.less b/components/Alert/style/index.less index adea040..e68a277 100644 --- a/components/Alert/style/index.less +++ b/components/Alert/style/index.less @@ -1,26 +1,27 @@ @import './var.less'; @alert-prefix-cls: ~"@{css-prefix}-alert"; + .@{alert-prefix-cls} { position: relative; padding: 8px 48px 8px 38px; border-radius: 4px; color: @font-color-base; - font-size: 12px; line-height: @line-height-base; margin-bottom: 10px; font-size: @font-size-default; transition: @transition-slow; - transform: scaleY(1.0); + transform: scaleY(1); transform-origin: 50% 0%; p { - margin: 0px; + margin: 0; } - + &-success { border: 1px solid #cfefdf; background-color: #ebf8f2; + .@{css-prefix}-icon { color: @color-success; } @@ -29,6 +30,7 @@ &-info { border: 1px solid #d2eafb; background-color: #ecf6fd; + .@{css-prefix}-icon { color: @color-info; } @@ -37,6 +39,7 @@ &-warning { border: 1px solid #fff3cf; background-color: #fffaeb; + .@{css-prefix}-icon { color: @color-warning; } @@ -45,6 +48,7 @@ &-error { border: 1px solid #fcdbd9; background-color: #fef0ef; + .@{css-prefix}-icon { color: @color-error; } @@ -53,6 +57,7 @@ &-normal { border: 1px solid @primary-color-hover; background-color: @primary-color-choosed; + .@{css-prefix}-icon { color: @primary-color; } @@ -94,14 +99,13 @@ } &-message { - color: rgba(0,0,0,.85); + color: rgba(0, 0, 0, 0.85); font-size: @font-size-large; } &-description { font-size: @font-size-default; padding-top: 5px; - } &-close { diff --git a/components/Alert/style/var.less b/components/Alert/style/var.less index c07f3fe..d9270b5 100644 --- a/components/Alert/style/var.less +++ b/components/Alert/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; -@import '../../Icon/style/index.less'; \ No newline at end of file +@import '../../Icon/style/index.less'; diff --git a/components/AutoComplete/style/index.less b/components/AutoComplete/style/index.less index 3c0865a..d692946 100644 --- a/components/AutoComplete/style/index.less +++ b/components/AutoComplete/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @auto-complete-prefix-cls: ~"@{css-prefix}-auto-complete"; + .@{auto-complete-prefix-cls} { position: relative; @@ -18,7 +19,7 @@ font-size: @font-size-default; transform-origin: 50% 0; z-index: @z-index-pop; - + .@{auto-complete-prefix-cls}-item { &:first-child { border-radius: @border-radius-large @border-radius-large 0 0; @@ -53,12 +54,12 @@ &-done-enter { display: block; - transform: scaleY(1); + transform: scaleY(1); } &-exit { display: block; - transform: scaleY(1); + transform: scaleY(1); } &-active-exit { diff --git a/components/AutoComplete/style/var.less b/components/AutoComplete/style/var.less index c7623d6..28412a4 100644 --- a/components/AutoComplete/style/var.less +++ b/components/AutoComplete/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Input/style/index.less'; diff --git a/components/Avatar/style/index.less b/components/Avatar/style/index.less index 14f1814..2f38756 100644 --- a/components/Avatar/style/index.less +++ b/components/Avatar/style/index.less @@ -1,12 +1,13 @@ @import './var.less'; @avatar-prefix-cls: ~"@{css-prefix}-avatar"; + .@{avatar-prefix-cls} { display: inline-block; text-align: center; background-color: @avatar-bgColor-default; color: white; - + &-circle { border-radius: 50%; overflow: hidden; @@ -14,6 +15,7 @@ &-square { border-radius: @avatar-square-radius; + img { border-radius: @avatar-square-radius; } @@ -40,7 +42,7 @@ width: @avatar-size-small; height: @avatar-size-small; line-height: @avatar-size-small; - + img { width: @avatar-size-small; height: @avatar-size-small; @@ -56,7 +58,7 @@ width: @avatar-size-large; height: @avatar-size-large; line-height: @avatar-size-large; - + img { width: @avatar-size-large; height: @avatar-size-large; @@ -66,4 +68,4 @@ font-size: @avatar-fontSize-large; line-height: @avatar-size-large; } -} \ No newline at end of file +} diff --git a/components/Avatar/style/var.less b/components/Avatar/style/var.less index cf65aee..6a3ef74 100644 --- a/components/Avatar/style/var.less +++ b/components/Avatar/style/var.less @@ -1,4 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; // avatar @@ -9,4 +9,4 @@ @avatar-fontSize-small: 14px; @avatar-fontSize-default: 18px; @avatar-fontSize-large: 24px; -@avatar-square-radius: 5px; \ No newline at end of file +@avatar-square-radius: 5px; diff --git a/components/BackTop/style/index.less b/components/BackTop/style/index.less index ea9bf5e..9aebac1 100644 --- a/components/BackTop/style/index.less +++ b/components/BackTop/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @backtop-prefix-cls: ~"@{css-prefix}-backtop"; + .@{backtop-prefix-cls} { position: fixed; cursor: pointer; @@ -10,8 +11,8 @@ &-default { background-color: @primary-color; border-radius: @border-radius-base; - box-shadow: 0 1px 3px rgba(0,0,0,.2); - transition: all .2s ease-in-out; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); + transition: all 0.2s ease-in-out; display: block; :hover { @@ -24,4 +25,4 @@ font-size: 24px; padding: 8px 12px; } -} \ No newline at end of file +} diff --git a/components/BackTop/style/var.less b/components/BackTop/style/var.less index ca1c08a..3f8009b 100644 --- a/components/BackTop/style/var.less +++ b/components/BackTop/style/var.less @@ -1,3 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; + diff --git a/components/Badge/style/index.less b/components/Badge/style/index.less index 92ba362..4e492a0 100644 --- a/components/Badge/style/index.less +++ b/components/Badge/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @badge-prefix-cls: ~"@{css-prefix}-badge"; + .@{badge-prefix-cls} { display: inline-block; position: relative; @@ -12,14 +13,13 @@ border: 1px solid white; font-size: @font-size-small; color: white; - } &-position { position: absolute; right: 0; top: 0; - transform: translateX(50%) translateY(-40%); + transform: translateX(50%) translateY(-40%); } &-dot { @@ -27,7 +27,7 @@ height: @badge-dot-size; } - &-count{ + &-count { padding: 0 6px; height: 20px; line-height: 20px; diff --git a/components/Badge/style/var.less b/components/Badge/style/var.less index 2614b1c..a7fd694 100644 --- a/components/Badge/style/var.less +++ b/components/Badge/style/var.less @@ -1,4 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; // badge diff --git a/components/Breadcrumb/style/index.less b/components/Breadcrumb/style/index.less index 07ba846..12518b8 100644 --- a/components/Breadcrumb/style/index.less +++ b/components/Breadcrumb/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @breadcrumb-prefix-cls: ~"@{css-prefix}-breadcrumb"; + .@{breadcrumb-prefix-cls} { &-separator { margin: 0 8px; @@ -14,5 +15,4 @@ } .@{breadcrumb-prefix-cls}-item { - -} \ No newline at end of file +} diff --git a/components/Breadcrumb/style/var.less b/components/Breadcrumb/style/var.less index a7ba615..8ba3670 100644 --- a/components/Breadcrumb/style/var.less +++ b/components/Breadcrumb/style/var.less @@ -1,2 +1,2 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; diff --git a/components/Button/style/index.less b/components/Button/style/index.less index 8fffdb8..745455e 100644 --- a/components/Button/style/index.less +++ b/components/Button/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @button-prefix-cls: ~"@{css-prefix}-button"; + .@{button-prefix-cls} { display: inline-block; border: @button-border; @@ -20,13 +21,16 @@ background-color: @button-disabled-bgColor; cursor: not-allowed; color: @button-border-color; - &:hover, &:focus { + + &:hover, + &:focus { border-color: @button-border-color; color: @button-border-color; } } - &:hover, &:focus { + &:hover, + &:focus { border-color: @button-primary-bgColor; color: @button-primary-bgColor; } @@ -40,7 +44,8 @@ background-color: @button-primary-bgColor; border-color: @button-primary-bgColor; - &:hover, &:focus { + &:hover, + &:focus { background-color: @button-primary-hover-bgColor; color: white; } @@ -52,15 +57,15 @@ &-dashed { color: @button-primary-bgColor; - border-style: dashed; - + border-style: dashed; } &-danger { background-color: @button-disabled-bgColor; color: @button-danger-color; - &:hover, &:focus { + &:hover, + &:focus { background-color: @button-danger-color; border-color: @button-danger-color; color: white; @@ -81,7 +86,6 @@ &-size-large { padding: 0 15px; - height: 32px; font-size: @font-size-default; height: @button-height-size-large; } @@ -89,7 +93,9 @@ &-ghost { background-color: transparent; color: white; - &:hover, &:focus { + + &:hover, + &:focus { background-color: transparent; } @@ -97,7 +103,7 @@ &-primary { color: @button-primary-bgColor; } - + &-danger { color: @button-danger-color; border-color: @button-danger-color; @@ -123,4 +129,4 @@ &-load { animation: rotate 1s infinite linear; } -} \ No newline at end of file +} diff --git a/components/Button/style/var.less b/components/Button/style/var.less index 25732e6..9bcb6e4 100644 --- a/components/Button/style/var.less +++ b/components/Button/style/var.less @@ -1,12 +1,11 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../styles/animation/rotate.less'; @import '../../Icon/style/index.less'; - //button @button-border: 1px solid transparent; -@button-border-radius: @border-radius-large; +@button-border-radius: @border-radius-large; @button-padding: 0 15px; @button-border-color: @border-color; @@ -22,4 +21,4 @@ @button-height-size-base: 28px; @button-height-size-small: 22px; -@button-height-size-large: 32px; \ No newline at end of file +@button-height-size-large: 32px; diff --git a/components/Card/style/index.less b/components/Card/style/index.less index 894de26..3b12561 100644 --- a/components/Card/style/index.less +++ b/components/Card/style/index.less @@ -1,16 +1,18 @@ @import './var.less'; @card-prefix-cls: ~"@{css-prefix}-card"; + .@{card-prefix-cls} { font-size: @font-size-default; background: white; - - &-head{ + + &-head { padding: 16px; overflow: hidden; border-bottom: @border-color-outline 1px solid; position: relative; } + &-title { } @@ -31,5 +33,4 @@ &-shadow { box-shadow: @shadow-base; } - -} \ No newline at end of file +} diff --git a/components/Card/style/var.less b/components/Card/style/var.less index a7ba615..8ba3670 100644 --- a/components/Card/style/var.less +++ b/components/Card/style/var.less @@ -1,2 +1,2 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; diff --git a/components/Carousel/style/index.less b/components/Carousel/style/index.less index 09189f4..f06ad0c 100644 --- a/components/Carousel/style/index.less +++ b/components/Carousel/style/index.less @@ -1,13 +1,13 @@ @import './var.less'; @carousel-prefix-cls: ~"@{css-prefix}-carousel"; + .@{carousel-prefix-cls} { position: relative; height: @carousel-height; overflow: hidden; &-list { - } &-child { @@ -44,15 +44,15 @@ &-child { float: left; } - + &-btn { top: 50%; transform: translateY(-50%); - + &-pre { left: @carousel-icon-left; } - + &-next { right: @carousel-icon-right; } @@ -63,7 +63,6 @@ left: 50%; transform: translateX(-50%); bottom: @carousel-dots-box-bottom; - } &-dot { @@ -74,7 +73,7 @@ } &-active-dot { - width: @carousel-dot-active-width + width: @carousel-dot-active-width; } } } @@ -87,11 +86,11 @@ &-btn { left: 50%; transform: translateX(-50%); - + &-pre { top: @carousel-icon-top; } - + &-next { bottom: @carousel-icon-bottom; } @@ -102,7 +101,6 @@ top: 50%; transform: translateY(-50%); right: @carousel-dots-box-right; - } &-dot { @@ -112,7 +110,7 @@ } &-active-dot { - height: @carousel-dot-active-width + height: @carousel-dot-active-width; } } } diff --git a/components/Carousel/style/var.less b/components/Carousel/style/var.less index 7871c84..a3a868c 100644 --- a/components/Carousel/style/var.less +++ b/components/Carousel/style/var.less @@ -22,8 +22,4 @@ @carousel-dot-gap: 4px; @carousel-dot-border-radius: @border-radius-base; - @carousel-dot-active-width: 24px; - - - diff --git a/components/Checkbox/style/index.less b/components/Checkbox/style/index.less index 16a2f43..6a66d8d 100644 --- a/components/Checkbox/style/index.less +++ b/components/Checkbox/style/index.less @@ -1,12 +1,12 @@ @import './var.less'; @checkbox-prefix-cls: ~"@{css-prefix}-checkbox"; + .@{checkbox-prefix-cls} { display: inline-block; height: @checkbox-size; width: @checkbox-size; font-size: @checkbox-size; - border: 1px solid @checkbox-border-color; vertical-align: middle; position: relative; @@ -41,11 +41,10 @@ margin: 0 10px; font-size: @font-size-default; } - } .@{checkbox-prefix-cls}-wrapper { - cursor: pointer; + cursor: pointer; } .@{checkbox-prefix-cls}-disabled { @@ -62,4 +61,4 @@ height: calc(@checkbox-size - 8px); } } -} \ No newline at end of file +} diff --git a/components/Checkbox/style/var.less b/components/Checkbox/style/var.less index 8866c2c..0bb4074 100644 --- a/components/Checkbox/style/var.less +++ b/components/Checkbox/style/var.less @@ -1,6 +1,6 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; // checkbox @checkbox-size: 16px; -@checkbox-border-color: @border-color; \ No newline at end of file +@checkbox-border-color: @border-color; diff --git a/components/Collapse/style/index.less b/components/Collapse/style/index.less index 35effb8..b79900e 100644 --- a/components/Collapse/style/index.less +++ b/components/Collapse/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @collapse-prefix-cls: ~"@{css-prefix}-collapse"; + .@{collapse-prefix-cls} { border-radius: @border-radius-large; border: 1px solid @border-color; @@ -11,8 +12,8 @@ } } - @panel-prefix-cls: ~"@{css-prefix}-panel"; + .@{panel-prefix-cls} { position: relative; border-bottom: 1px solid @border-color; diff --git a/components/Collapse/style/var.less b/components/Collapse/style/var.less index 1d46f0c..f235c30 100644 --- a/components/Collapse/style/var.less +++ b/components/Collapse/style/var.less @@ -1,8 +1,7 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; @import '../../Transitions/style/index.less'; - // panel -@panel-bgColor: @background-color; \ No newline at end of file +@panel-bgColor: @background-color; diff --git a/components/Divider/style/index.less b/components/Divider/style/index.less index 1f8ad52..9f18e55 100644 --- a/components/Divider/style/index.less +++ b/components/Divider/style/index.less @@ -1,7 +1,7 @@ @import './var.less'; @divider-prefix-cls: ~"@{css-prefix}-divider"; -@line-color: #e8e8e8; + .@{divider-prefix-cls} { display: table; vertical-align: middle; diff --git a/components/Divider/style/var.less b/components/Divider/style/var.less index e985b6e..7f85170 100644 --- a/components/Divider/style/var.less +++ b/components/Divider/style/var.less @@ -1,2 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; + +@line-color: #e8e8e8; diff --git a/components/Drawer/style/index.less b/components/Drawer/style/index.less index 3217236..df75758 100644 --- a/components/Drawer/style/index.less +++ b/components/Drawer/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @drawer-prefix-cls: ~"@{css-prefix}-drawer"; + .@{drawer-prefix-cls} { position: fixed; top: 0; diff --git a/components/Drawer/style/var.less b/components/Drawer/style/var.less index 71cb375..9d57273 100644 --- a/components/Drawer/style/var.less +++ b/components/Drawer/style/var.less @@ -1,5 +1,4 @@ @import '../../styles/var.less'; @import '../../Transitions/style/index.less'; - @drawer-shadow: 1px 1px 20px #383636; diff --git a/components/Helpers/style/index.less b/components/Helpers/style/index.less index 2c1369b..59545fc 100644 --- a/components/Helpers/style/index.less +++ b/components/Helpers/style/index.less @@ -1,6 +1,6 @@ @import './var.less'; @helpers-prefix-cls: ~"@{css-prefix}-helpers"; -.@{helpers-prefix-cls} { +.@{helpers-prefix-cls} { } diff --git a/components/Helpers/style/var.less b/components/Helpers/style/var.less index 42aa31e..b514cfb 100644 --- a/components/Helpers/style/var.less +++ b/components/Helpers/style/var.less @@ -1 +1 @@ -@import '../../styles/var.less'; \ No newline at end of file +@import '../../styles/var.less'; diff --git a/components/Icon/style/index.less b/components/Icon/style/index.less index 7173259..e4b1396 100644 --- a/components/Icon/style/index.less +++ b/components/Icon/style/index.less @@ -1,6 +1,6 @@ @import './var.less'; @icon-prefix-cls: ~"@{css-prefix}-icon"; + .@{icon-prefix-cls} { - } diff --git a/components/Icon/style/var.less b/components/Icon/style/var.less index e41d571..31bfad0 100644 --- a/components/Icon/style/var.less +++ b/components/Icon/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; -@import '../../styles/common/iconfont/ionicons.less'; \ No newline at end of file +@import '../../styles/common/iconfont/ionicons.less'; diff --git a/components/Input/style/index.less b/components/Input/style/index.less index 966f005..4ba6abd 100644 --- a/components/Input/style/index.less +++ b/components/Input/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @input-prefix-cls: ~"@{css-prefix}-input"; + .@{input-prefix-cls} { border: @input-border; border-radius: @input-border-radius; @@ -28,7 +29,6 @@ position: relative; overflow: hidden; vertical-align: middle; - } &-header { @@ -50,7 +50,6 @@ padding: 4px 11px; font-size: @font-size-small; } - .@{input-prefix-cls}-footer, .@{input-prefix-cls}-header { @@ -66,7 +65,6 @@ padding: 1px 7px; font-size: @font-size-default; } - .@{input-prefix-cls}-footer, .@{input-prefix-cls}-header { @@ -83,7 +81,6 @@ font-size: @font-size-large; } - .@{input-prefix-cls}-footer, .@{input-prefix-cls}-header { > * { @@ -96,7 +93,7 @@ display: table; line-height: 1; width: 100%; - + .@{input-prefix-cls}:not(:first-child):not(:last-child) { border-radius: 0; } diff --git a/components/Input/style/var.less b/components/Input/style/var.less index cb9de68..d6cf27e 100644 --- a/components/Input/style/var.less +++ b/components/Input/style/var.less @@ -1,4 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; // input @@ -9,4 +9,4 @@ @input-border: 1px solid @input-border-color; @input-border-radius: @border-radius-large; @input-box-shadow: 0 0 0 2px @primary-color-choosed; -@input-extra-item-bgColor: @background-color; \ No newline at end of file +@input-extra-item-bgColor: @background-color; diff --git a/components/InputNumber/style/index.less b/components/InputNumber/style/index.less index c3dfdd4..2703b02 100644 --- a/components/InputNumber/style/index.less +++ b/components/InputNumber/style/index.less @@ -1,12 +1,13 @@ @import './var.less'; @inputnumber-prefix-cls: ~"@{css-prefix}-input-number"; + .@{inputnumber-prefix-cls} { border: @input-border; border-radius: @input-border-radius; width: 100%; padding-right: 25px !important; - + &:hover, &:active, &:focus { @@ -55,13 +56,13 @@ height: 50%; color: @input-border-color; font-weight: bold; - + &:first-child { border-bottom: @input-border; } &:hover { - color:@primary-color; + color: @primary-color; cursor: pointer; } @@ -71,7 +72,7 @@ text-align: center; display: flex; align-items: center; - justify-content:center; + justify-content: center; transform: scale(0.8); font-weight: 700; } diff --git a/components/InputNumber/style/var.less b/components/InputNumber/style/var.less index 1e6272e..66ebd81 100644 --- a/components/InputNumber/style/var.less +++ b/components/InputNumber/style/var.less @@ -1,4 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @input-size-small: 24px; @@ -7,5 +7,5 @@ @input-border-color: @border-color; @input-border: 1px solid @input-border-color; @input-border-radius: @border-radius-large; -@input-box-shadow: 0 0 0 2px @primary-color-choosed;; -@input-extra-item-bgColor: @background-color; \ No newline at end of file +@input-box-shadow: 0 0 0 2px @primary-color-choosed; +@input-extra-item-bgColor: @background-color; diff --git a/components/Loading/style/index.less b/components/Loading/style/index.less index 90b8798..65607c4 100644 --- a/components/Loading/style/index.less +++ b/components/Loading/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @loading-prefix-cls: ~"@{css-prefix}-loading"; + .@{loading-prefix-cls} { color: @primary-color; text-align: center; diff --git a/components/Loading/style/var.less b/components/Loading/style/var.less index 1105d27..fcf1fc8 100644 --- a/components/Loading/style/var.less +++ b/components/Loading/style/var.less @@ -1,10 +1,9 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../styles/animation/rotate.less'; @import '../../Icon/style/index.less'; - // loading @loading-size-small: 14px; @loading-size-default: 20px; -@loading-size-large: 32px; \ No newline at end of file +@loading-size-large: 32px; diff --git a/components/Menu/style/index.less b/components/Menu/style/index.less index 20ed727..cbbf3b9 100644 --- a/components/Menu/style/index.less +++ b/components/Menu/style/index.less @@ -1,11 +1,13 @@ @import './var.less'; @menu-prefix-cls: ~"@{css-prefix}-menu"; + .@{menu-prefix-cls} { border-right: 1px solid @color-unactive; } @sub-menu-prefix-cls: ~"@{css-prefix}-sub-menu"; + .@{sub-menu-prefix-cls} { * { transition: @transition-base; @@ -22,7 +24,7 @@ text-overflow: ellipsis; white-space: nowrap; padding-right: 40px; - + &:hover { color: @primary-color; } @@ -39,13 +41,11 @@ } } - &-container { overflow: hidden; } &-list { - } &-hidden { @@ -54,7 +54,6 @@ } } - &-icon { position: absolute; right: 15px; @@ -65,6 +64,7 @@ } @menu-item-group-prefix-cls: ~"@{css-prefix}-menu-item-group"; + .@{menu-item-group-prefix-cls} { &-title { font-size: @font-size-default; @@ -73,12 +73,12 @@ color: @color-disabled; overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; + white-space: nowrap; } } - @menu-item-prefix-cls: ~"@{css-prefix}-menu-item"; + .@{menu-item-prefix-cls} { font-size: @font-size-default; height: 40px; @@ -90,7 +90,7 @@ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - + &:hover:not(&-disabled) { color: @primary-color; } diff --git a/components/Menu/style/var.less b/components/Menu/style/var.less index f0ef1fa..3a5c281 100644 --- a/components/Menu/style/var.less +++ b/components/Menu/style/var.less @@ -1,4 +1,4 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; @import '../../Transitions/style/index.less'; diff --git a/components/Message/style/index.less b/components/Message/style/index.less index 97bfbe8..289d7cb 100644 --- a/components/Message/style/index.less +++ b/components/Message/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @message-prefix-cls: ~"@{css-prefix}-message"; + .@{message-prefix-cls} { padding: @message-box-padding; pointer-events: none; @@ -24,7 +25,6 @@ border-radius: @message-content-border-radius; } - .@{css-prefix}-icon { font-size: 16px; vertical-align: middle; diff --git a/components/Modal/style/index.less b/components/Modal/style/index.less index ae6b68f..011fca4 100644 --- a/components/Modal/style/index.less +++ b/components/Modal/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @modal-prefix-cls: ~"@{css-prefix}-modal"; + .@{modal-prefix-cls} { padding: @modal-padding; box-shadow: @modal-shadow; @@ -18,7 +19,7 @@ display: inline-block; width: calc(100% - @icon-width); vertical-align: middle; - + &-no-icon { width: 100%; } @@ -63,7 +64,7 @@ font-size: @icon-font-size; &-info { - color: @color-info + color: @color-info; } &-success { diff --git a/components/Modal/style/var.less b/components/Modal/style/var.less index 70a9570..0adbc35 100644 --- a/components/Modal/style/var.less +++ b/components/Modal/style/var.less @@ -16,4 +16,4 @@ @title-font-color: black; @content-font-size: @font-size-default; -@content-font-color: rgba(0,0,0,.65); \ No newline at end of file +@content-font-color: rgba(0, 0, 0, 0.65); diff --git a/components/Notification/style/index.less b/components/Notification/style/index.less index 595f7f9..ec8d06c 100644 --- a/components/Notification/style/index.less +++ b/components/Notification/style/index.less @@ -1,6 +1,6 @@ @import './var.less'; @notification-prefix-cls: ~"@{css-prefix}-notification"; -.@{notification-prefix-cls} { +.@{notification-prefix-cls} { } diff --git a/components/Notification/style/var.less b/components/Notification/style/var.less index f98d1e3..d2a265c 100644 --- a/components/Notification/style/var.less +++ b/components/Notification/style/var.less @@ -1,2 +1,2 @@ @import '../../styles/var.less'; -@import '../../Alert/style/index.less'; \ No newline at end of file +@import '../../Alert/style/index.less'; diff --git a/components/Pagination/style/index.less b/components/Pagination/style/index.less index 0610c2c..bc93b8a 100644 --- a/components/Pagination/style/index.less +++ b/components/Pagination/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @pagination-prefix-cls: ~"@{css-prefix}-pagination"; + .@{pagination-prefix-cls} { user-select: none; diff --git a/components/Pagination/style/var.less b/components/Pagination/style/var.less index 91bbf3c..38e5e16 100644 --- a/components/Pagination/style/var.less +++ b/components/Pagination/style/var.less @@ -1,7 +1,7 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; // pagination @pagination-size: 32px; -@pagination-border: 1px solid @border-color; \ No newline at end of file +@pagination-border: 1px solid @border-color; diff --git a/components/Pop/style/index.less b/components/Pop/style/index.less index 9da11d2..e0b7753 100644 --- a/components/Pop/style/index.less +++ b/components/Pop/style/index.less @@ -1,7 +1,7 @@ @import './var.less'; @pop-prefix-cls: ~"@{css-prefix}-pop"; -@pop-scale: scale(0.8); + .@{pop-prefix-cls} { position: absolute; outline: 0; diff --git a/components/Pop/style/var.less b/components/Pop/style/var.less index a7ba615..45597fd 100644 --- a/components/Pop/style/var.less +++ b/components/Pop/style/var.less @@ -1,2 +1,4 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; + +@pop-scale: scale(0.8); diff --git a/components/Progress/style/index.less b/components/Progress/style/index.less index af7c439..fc4e311 100644 --- a/components/Progress/style/index.less +++ b/components/Progress/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @progress-prefix-cls: ~"@{css-prefix}-progress"; + .@{progress-prefix-cls} { position: relative; width: 100%; @@ -26,7 +27,7 @@ left: 0; background: white; border-radius: 100px; - animation: progress-animation 1.5s cubic-bezier(.645,.045,.355,1) infinite;; + animation: progress-animation 1.5s cubic-bezier(0.645, 0.045, 0.355, 1) infinite; } } } diff --git a/components/Progress/style/var.less b/components/Progress/style/var.less index 1522b32..f829dc5 100644 --- a/components/Progress/style/var.less +++ b/components/Progress/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; -@import '../../styles/animation/progress.less'; \ No newline at end of file +@import '../../styles/animation/progress.less'; diff --git a/components/Radio/style/index.less b/components/Radio/style/index.less index 484ed09..31c75e0 100644 --- a/components/Radio/style/index.less +++ b/components/Radio/style/index.less @@ -1,12 +1,12 @@ @import './var.less'; @radio-prefix-cls: ~"@{css-prefix}-radio"; + .@{radio-prefix-cls} { display: inline-block; height: @radio-size; width: @radio-size; font-size: @radio-size; - border-radius: 50%; border: 1px solid @radio-border-color; vertical-align: middle; @@ -43,11 +43,10 @@ margin: 0 10px; font-size: @font-size-default; } - } .@{radio-prefix-cls}-wrapper { - cursor: pointer; + cursor: pointer; } .@{radio-prefix-cls}-disabled { @@ -64,4 +63,4 @@ height: calc(@radio-size - 8px); } } -} \ No newline at end of file +} diff --git a/components/Radio/style/var.less b/components/Radio/style/var.less index 940745a..a89e72e 100644 --- a/components/Radio/style/var.less +++ b/components/Radio/style/var.less @@ -1,7 +1,6 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; - // radio @radio-size: 16px; -@radio-border-color: @border-color; \ No newline at end of file +@radio-border-color: @border-color; diff --git a/components/Rate/style/index.less b/components/Rate/style/index.less index 07bb034..d726261 100644 --- a/components/Rate/style/index.less +++ b/components/Rate/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @rate-prefix-cls: ~"@{css-prefix}-rate"; + .@{rate-prefix-cls} { &-item { transition: @transition-quick; @@ -19,7 +20,6 @@ } .@{rate-prefix-cls}-first-child { - } .@{rate-prefix-cls}-last-child { diff --git a/components/Rate/style/var.less b/components/Rate/style/var.less index c07f3fe..d9270b5 100644 --- a/components/Rate/style/var.less +++ b/components/Rate/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; -@import '../../Icon/style/index.less'; \ No newline at end of file +@import '../../Icon/style/index.less'; diff --git a/components/Ripple/style/index.less b/components/Ripple/style/index.less index 3b4761f..d3902ad 100644 --- a/components/Ripple/style/index.less +++ b/components/Ripple/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @ripple-prefix-cls: ~"@{css-prefix}-ripple"; + .@{ripple-prefix-cls} { display: inline-block; } diff --git a/components/Ripple/style/var.less b/components/Ripple/style/var.less index a7ba615..8ba3670 100644 --- a/components/Ripple/style/var.less +++ b/components/Ripple/style/var.less @@ -1,2 +1,2 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; diff --git a/components/Select/style/index.less b/components/Select/style/index.less index 4531d02..ae217f8 100644 --- a/components/Select/style/index.less +++ b/components/Select/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @select-prefix-cls: ~"@{css-prefix}-select"; + .@{select-prefix-cls} { position: relative; border: @select-border; @@ -32,8 +33,6 @@ color: @disabled-color; } - - &-small { font-size: @select-font-size-small; } @@ -53,12 +52,12 @@ height: @select-size-small; line-height: @select-size-small; } - + &-default { height: @select-size-default; line-height: @select-size-default; } - + &-large { height: @select-size-large; line-height: @select-size-large; @@ -79,7 +78,7 @@ margin-top: 4px; } } - + &-default { min-height: @select-size-default; @@ -90,7 +89,7 @@ margin-top: 4px; } } - + &-large { min-height: @select-size-large; @@ -104,7 +103,6 @@ } } - &-list { background: white; border-radius: @border-radius-large; @@ -120,7 +118,6 @@ } } - &-icon { position: absolute; right: 15px; @@ -153,13 +150,12 @@ } } - .@{select-prefix-cls}-option { cursor: pointer; font-size: @select-option-font-size; padding: @select-option-padding; user-select: none; - + &:hover { background: @primary-color-choosed; } diff --git a/components/Select/style/var.less b/components/Select/style/var.less index 8775b19..e4c7a33 100644 --- a/components/Select/style/var.less +++ b/components/Select/style/var.less @@ -3,15 +3,12 @@ @import '../../Pop/style/index.less'; @import '../../Transitions/style/index.less'; - - @select-option-padding: 5px 12px; @select-option-font-size: 14px; @select-option-group-padding: 0 12px; @select-option-group-font-size: 12px; - @select-size-small: 24px; @select-size-default: 32px; @select-size-large: 40px; diff --git a/components/Slider/style/index.less b/components/Slider/style/index.less index eccf11e..9124747 100644 --- a/components/Slider/style/index.less +++ b/components/Slider/style/index.less @@ -1,11 +1,12 @@ @import './var.less'; @slider-prefix-cls: ~"@{css-prefix}-slider"; + .@{slider-prefix-cls} { position: relative; cursor: pointer; height: @slider-bar-size; - + &-process { width: 100%; height: @slider-process-height; @@ -20,7 +21,7 @@ height: @slider-process-height; background: @primary-color; border-radius: @border-radius-large; - + &::after { display: inline-block; content: ' '; @@ -42,7 +43,7 @@ .@{slider-prefix-cls}-bar { background: @color-disabled; - + &::after { cursor: not-allowed; border-color: @color-disabled; diff --git a/components/Slider/style/var.less b/components/Slider/style/var.less index 57dcb05..abbb29c 100644 --- a/components/Slider/style/var.less +++ b/components/Slider/style/var.less @@ -1,6 +1,6 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; // slider @slider-bar-size: 14px; -@slider-process-height: 4px; \ No newline at end of file +@slider-process-height: 4px; diff --git a/components/Steps/style/index.less b/components/Steps/style/index.less index 6c24d84..e0ea9ae 100644 --- a/components/Steps/style/index.less +++ b/components/Steps/style/index.less @@ -1,17 +1,17 @@ @import './var.less'; @steps-prefix-cls: ~"@{css-prefix}-steps"; + .@{steps-prefix-cls} { display: flex; justify-content: space-between; overflow: hidden; - + > * { transition: @transition-base; } &-horizontal { - } &-vertical { @@ -33,10 +33,9 @@ } } - .@{itemPreCls}:last-child { flex: none; - + .@{itemPreCls}-title::after { display: none; } @@ -49,8 +48,8 @@ } } - @itemPreCls: ~'@{steps-prefix-cls}-item'; + .@{itemPreCls} { overflow: hidden; flex: 1; @@ -71,6 +70,7 @@ &-wait { color: @color-unactive; + .@{itemPreCls}-icon { color: @color-unactive; border-color: @color-unactive; @@ -84,15 +84,16 @@ &-error { color: @color-error; + .@{itemPreCls}-icon { - color: @color-error;; - border-color: @color-error;; + color: @color-error; + border-color: @color-error; background-color: white; } .@{itemPreCls}-title::after, .@{itemPreCls}-line-vertical { - background-color: @color-error;; + background-color: @color-error; } } @@ -104,7 +105,7 @@ line-height: 100%; vertical-align: top; margin-right: 10px; - color: @primary-color; + color: @primary-color; position: relative; float: left; } @@ -144,6 +145,7 @@ .@{itemPreCls}-small { font-size: @font-size-default; + .@{itemPreCls}-icon { width: @steps-size-small; height: @steps-size-small; @@ -152,7 +154,7 @@ .@{itemPreCls}-title { line-height: @steps-size-small; - + &::after { } } @@ -173,6 +175,7 @@ .@{itemPreCls}-title { line-height: @steps-size-default; + &::after { } } diff --git a/components/Steps/style/var.less b/components/Steps/style/var.less index 68c15cd..7c37c7b 100644 --- a/components/Steps/style/var.less +++ b/components/Steps/style/var.less @@ -1,7 +1,7 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; // steps @steps-size-default: 32px; -@steps-size-small: 24px; \ No newline at end of file +@steps-size-small: 24px; diff --git a/components/Switch/style/index.less b/components/Switch/style/index.less index 181df9b..1254d61 100644 --- a/components/Switch/style/index.less +++ b/components/Switch/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @switch-prefix-cls: ~"@{css-prefix}-switch"; + .@{switch-prefix-cls} { display: inline-block; border-radius: 100px; @@ -42,6 +43,7 @@ &-checked { background-color: @primary-color; + &::after { left: 100%; } diff --git a/components/Switch/style/var.less b/components/Switch/style/var.less index a7ba615..8ba3670 100644 --- a/components/Switch/style/var.less +++ b/components/Switch/style/var.less @@ -1,2 +1,2 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; diff --git a/components/Table/style/index.less b/components/Table/style/index.less index d93a543..9d93228 100644 --- a/components/Table/style/index.less +++ b/components/Table/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @table-prefix-cls: ~"@{css-prefix}-table"; + .@{table-prefix-cls} { overflow: hidden; position: relative; @@ -103,7 +104,6 @@ z-index: 1; } - .shadow { display: block; width: 10px; @@ -116,4 +116,3 @@ z-index: 3; } } - diff --git a/components/Table/style/var.less b/components/Table/style/var.less index 42aa31e..b514cfb 100644 --- a/components/Table/style/var.less +++ b/components/Table/style/var.less @@ -1 +1 @@ -@import '../../styles/var.less'; \ No newline at end of file +@import '../../styles/var.less'; diff --git a/components/Tabs/style/card.less b/components/Tabs/style/card.less index 5856501..632de75 100644 --- a/components/Tabs/style/card.less +++ b/components/Tabs/style/card.less @@ -14,14 +14,14 @@ } &-card&-small &-nav-scroll { - line-height: @tab-card-height-small; + line-height: @tab-card-height-small; } &-card&-default &-nav-scroll { - line-height: @tab-card-height-default; + line-height: @tab-card-height-default; } &-card&-large &-nav-scroll { - line-height: @tab-card-height-large; + line-height: @tab-card-height-large; } } diff --git a/components/Tabs/style/horizontal.less b/components/Tabs/style/horizontal.less index 42f3395..1a6e9ef 100644 --- a/components/Tabs/style/horizontal.less +++ b/components/Tabs/style/horizontal.less @@ -84,4 +84,4 @@ } } } -} \ No newline at end of file +} diff --git a/components/Tabs/style/index.less b/components/Tabs/style/index.less index 0122575..7a54272 100644 --- a/components/Tabs/style/index.less +++ b/components/Tabs/style/index.less @@ -5,6 +5,7 @@ @import './card.less'; @tabs-prefix-cls: ~"@{css-prefix}-tabs"; + .@{tabs-prefix-cls} { overflow: hidden; @@ -42,7 +43,7 @@ color: @color-disabled; } } - + &-content { display: flex; transition: @tab-transition; @@ -59,7 +60,6 @@ } } - &-small &-tab { padding: @tab-pane-size-small-padding; font-size: @tab-pane-size-small-font-size; diff --git a/components/Tabs/style/panel.less b/components/Tabs/style/panel.less index 792fd1c..1cf64fc 100644 --- a/components/Tabs/style/panel.less +++ b/components/Tabs/style/panel.less @@ -11,4 +11,4 @@ opacity: 0; height: 0; } -} \ No newline at end of file +} diff --git a/components/Tabs/style/var.less b/components/Tabs/style/var.less index 0e99ad4..304a5e9 100644 --- a/components/Tabs/style/var.less +++ b/components/Tabs/style/var.less @@ -18,4 +18,4 @@ @tab-card-height-small: 24px; @tab-card-height-default: 32px; -@tab-card-height-large: 40px; \ No newline at end of file +@tab-card-height-large: 40px; diff --git a/components/Tabs/style/vertical.less b/components/Tabs/style/vertical.less index b345728..f0ffb96 100644 --- a/components/Tabs/style/vertical.less +++ b/components/Tabs/style/vertical.less @@ -77,4 +77,4 @@ } } } -} \ No newline at end of file +} diff --git a/components/Tag/style/index.less b/components/Tag/style/index.less index bb60f2d..b6b651d 100644 --- a/components/Tag/style/index.less +++ b/components/Tag/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @tag-prefix-cls: ~"@{css-prefix}-tag"; + .@{tag-prefix-cls} { display: inline-block; padding: 0 5px; @@ -13,7 +14,6 @@ color: @tag-font-color; cursor: pointer; - &-close { font-size: 12px; margin-left: 5px; diff --git a/components/Tag/style/var.less b/components/Tag/style/var.less index 108cc6f..3184bf4 100644 --- a/components/Tag/style/var.less +++ b/components/Tag/style/var.less @@ -1,8 +1,8 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; @import '../../Icon/style/index.less'; // tag @tag-bgColor: @background-color; @tag-border-color: @border-color; -@tag-font-color: rgba(0,0,0,.65); \ No newline at end of file +@tag-font-color: rgba(0, 0, 0, 0.65); diff --git a/components/Timeline/style/index.less b/components/Timeline/style/index.less index f4778a5..d017d1b 100644 --- a/components/Timeline/style/index.less +++ b/components/Timeline/style/index.less @@ -1,6 +1,7 @@ @import './var.less'; @timeline-prefix-cls: ~"@{css-prefix}-timeline"; + .@{timeline-prefix-cls} { .@{timeline-prefix-cls}-item:last-child { .@{timeline-prefix-cls}-item-line { @@ -12,39 +13,39 @@ .@{timeline-prefix-cls}-item { position: relative; - &-line{ + &-line { position: absolute; height: 100%; border-color: @color-unactive; } - - &-icon{ + + &-icon { position: absolute; box-sizing: border-box; background-color: white; - > div{ + > div { border-color: @primary-color; } } - - &-content{ + + &-content { position: relative; padding-bottom: 20px; } - &-customed{ + &-customed { position: absolute; } - &-time{ + &-time { font-weight: bold; font-size: 15px; position: relative; top: -10px; } - &-des{ + &-des { font-size: 16px; } } diff --git a/components/Timeline/style/var.less b/components/Timeline/style/var.less index a7ba615..8ba3670 100644 --- a/components/Timeline/style/var.less +++ b/components/Timeline/style/var.less @@ -1,2 +1,2 @@ -@import '../../styles/var.less'; -@import '../../styles/common/reset.less'; \ No newline at end of file +@import '../../styles/var.less'; +@import '../../styles/common/reset.less'; diff --git a/components/Tooltip/style/index.less b/components/Tooltip/style/index.less index 48324fb..996f105 100644 --- a/components/Tooltip/style/index.less +++ b/components/Tooltip/style/index.less @@ -5,8 +5,7 @@ .@{tooltip-prefix-cls} { position: relative; - - transition: opacity .3s cubic-bezier(.645,.045,.355,1); + transition: opacity 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); &-arrow { position: absolute; @@ -18,7 +17,7 @@ &-content { padding: 5px; - background: rgba(0,0,0,.75); + background: rgba(0, 0, 0, 0.75); font-size: @font-size-small; color: white; border-radius: @border-radius-large; @@ -32,7 +31,7 @@ .@{tooltip-prefix-cls}-arrow { bottom: 3px; border-width: 5px 5px 0; - border-top-color: rgba(0,0,0,.75); + border-top-color: rgba(0, 0, 0, 0.75); } .@{tooltip-prefix-cls}-content { @@ -62,7 +61,7 @@ .@{tooltip-prefix-cls}-arrow { top: 3px; border-width: 0 5px 5px; - border-bottom-color: rgba(0,0,0,.75); + border-bottom-color: rgba(0, 0, 0, 0.75); } .@{tooltip-prefix-cls}-content { @@ -70,14 +69,13 @@ } } - &-left, &-leftTop, &-leftBottom { .@{tooltip-prefix-cls}-arrow { right: 3px; border-width: 5px 0 5px 5px; - border-left-color: rgba(0,0,0,.75); + border-left-color: rgba(0, 0, 0, 0.75); } .@{tooltip-prefix-cls}-content { @@ -86,7 +84,7 @@ } &-left > &-arrow, - &-right > &-arrow { + &-right > &-arrow { top: 50%; transform: translateY(-50%); } @@ -107,7 +105,7 @@ .@{tooltip-prefix-cls}-arrow { left: 3px; border-width: 5px 5px 5px 0; - border-right-color: rgba(0,0,0,.75); + border-right-color: rgba(0, 0, 0, 0.75); } .@{tooltip-prefix-cls}-content { diff --git a/components/Tooltip/style/var.less b/components/Tooltip/style/var.less index 31c3b32..b59974a 100644 --- a/components/Tooltip/style/var.less +++ b/components/Tooltip/style/var.less @@ -1,3 +1,3 @@ -@import '../../styles/var.less'; +@import '../../styles/var.less'; @import '../../styles/common/reset.less'; -@import '../../Pop/style/index.less'; \ No newline at end of file +@import '../../Pop/style/index.less'; diff --git a/components/Transitions/style/index.less b/components/Transitions/style/index.less index 26b33c6..28828f6 100644 --- a/components/Transitions/style/index.less +++ b/components/Transitions/style/index.less @@ -1,12 +1,13 @@ @import './var.less'; @expand-prefix-cls: ~"@{css-prefix}-expand"; + .@{expand-prefix-cls} { overflow: hidden; } @slide-prefix-cls: ~"@{css-prefix}-slide"; + .@{slide-prefix-cls} { - } diff --git a/components/Transitions/style/var.less b/components/Transitions/style/var.less index 42aa31e..b514cfb 100644 --- a/components/Transitions/style/var.less +++ b/components/Transitions/style/var.less @@ -1 +1 @@ -@import '../../styles/var.less'; \ No newline at end of file +@import '../../styles/var.less'; diff --git a/components/styles/common/reset.less b/components/styles/common/reset.less index bb0463d..e30bde3 100644 --- a/components/styles/common/reset.less +++ b/components/styles/common/reset.less @@ -1,5 +1,6 @@ /* 全局样式重置 */ @import '../var.less'; + /* 设置所有盒子大小计算边框内 */ *, *::before, @@ -11,7 +12,7 @@ } body { - font-family: Monospaced Number,Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif; + font-family: Monospaced Number, Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif; } /* 消除阴影和边框 */ @@ -56,7 +57,8 @@ a { display: none; } -ul, li { +ul, +li { list-style: none; } diff --git a/components/styles/var.less b/components/styles/var.less index d459a17..744eed2 100644 --- a/components/styles/var.less +++ b/components/styles/var.less @@ -1,16 +1,13 @@ // Prefix @css-prefix: yoshino; - //Base - @line-height-base: 1.5; // transition -@transition-quick: all .1s cubic-bezier(.645,.045,.355,1); -@transition-base: all .3s cubic-bezier(.645,.045,.355,1); -@transition-slow: all .5s cubic-bezier(.645,.045,.355,1); - +@transition-quick: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); +@transition-base: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); +@transition-slow: all 0.5s cubic-bezier(0.645, 0.045, 0.355, 1); // primary @primary-color: rgb(81, 178, 109); // 主色调 @@ -22,7 +19,7 @@ @font-size-small: 12px; @font-size-default: 14px; @font-size-large: 16px; -@font-color-base: rgba(0,0,0,.65); +@font-color-base: rgba(0, 0, 0, 0.65); @font-weight-base: 500; @@ -36,7 +33,7 @@ @background-color: #fafafa; // Shadow -@shadow-base: 0 2px 8px rgba(0,0,0,.15); +@shadow-base: 0 2px 8px rgba(0, 0, 0, 0.15); // color @color-warning: #ffbf00; @@ -53,13 +50,10 @@ // 遮罩颜色 @mask-color: rgba(0, 0, 0, 0.65); -// transform +// transform @transform-roate-half: translateY(-50%) rotate(180deg); // disabled - 禁用 @disabled-color: rgba(0, 0, 0, 0.25); // 字体色 @disabled-background-color: #f5f5f5; // 禁用背景色 @disabled-border-color: #d9d9d9; // 禁用边框色 - - - diff --git a/package.json b/package.json index 099a14b..336b596 100755 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "new:docs": "node scripts/new-docs.js", "precommit": "npm run lint", "lint:ts": "tslint -p .", - "lint:less": "stylelint 'components/**/**.less --syntax less'", + "lint:less": "stylelint 'components/!(styles)/**/**.less' --syntax less", "lint": "npm run lint:less && npm run lint:ts", "test": "jest", "site:pull": "git clone https://github.com/Yoshino-UI/yoshino-ui.github.io.git build" @@ -90,10 +90,6 @@ "babel-plugin-syntax-dynamic-import": "^6.18.0", "css-hot-loader": "^1.4.1", "css-loader": "^0.28.11", - "less": "^3.0.1", - "prismjs": "^1.14.0", - "url-loader": "^1.0.1", - "less-loader": "^4.1.0", "cz-conventional-changelog": "^2.1.0", "file-loader": "^1.1.11", "fork-ts-checker-webpack-plugin": "^0.4.2", @@ -106,6 +102,8 @@ "html-webpack-plugin": "^3.2.0", "husky": "^0.14.3", "jest": "^22.4.3", + "less": "^3.0.1", + "less-loader": "^4.1.0", "less-plugin-autoprefix": "^1.5.1", "marked": "^0.3.19", "postcss-cli": "^4.1.1", @@ -117,6 +115,7 @@ "postcss-nested": "^3.0.0", "postcss-px2rem": "^0.3.0", "postcss-remove-root": "0.0.2", + "prismjs": "^1.14.0", "raw-loader": "^0.5.1", "react-docgen-typescript": "^1.3.0", "react-loadable": "^5.4.0", @@ -133,6 +132,7 @@ "tslint": "^5.9.1", "tslint-react": "^3.5.1", "typescript": "^2.8.3", + "url-loader": "^1.0.1", "webpack": "^4.5.0", "webpack-cli": "^2.0.15", "webpack-dev-server": "^3.1.3" diff --git a/scripts/new-component.js b/scripts/new-component.js index cbd620d..66d0921 100644 --- a/scripts/new-component.js +++ b/scripts/new-component.js @@ -22,6 +22,7 @@ function fileIndexScss(component) { const content = `@import './var.less'; @${name}-prefix-cls: ~"@{css-prefix}-${name}"; + .@{${name}-prefix-cls} { }