From d8cea7489dd00ddc894da3d757ba2356bb8b7f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 31 Dec 2019 15:04:00 +0800 Subject: [PATCH] :lipstick: fix stylelint warnings and errors (#20562) --- .stylelintrc.json | 3 +- components/calendar/style/index.less | 2 - components/date-picker/style/index.less | 9 +-- components/date-picker/style/panel.less | 12 +-- components/table/style/index.less | 97 ++++++------------------- components/table/style/radius.less | 45 ++++++++++++ 6 files changed, 75 insertions(+), 93 deletions(-) create mode 100644 components/table/style/radius.less diff --git a/.stylelintrc.json b/.stylelintrc.json index 7daffb406e..40ce56859f 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -9,8 +9,7 @@ "comment-empty-line-before": null, "function-name-case": ["lower", { "ignoreFunctions": ["/colorPalette/"] }], "no-invalid-double-slash-comments": null, - "no-duplicate-selectors": null, - "no-descending-specificity": [true, { "severity": "warning" }], + "no-descending-specificity": null, "declaration-empty-line-before": null }, "ignoreFiles": ["components/style/color/{bezierEasing,colorPalette,tinyColor}.less"] diff --git a/components/calendar/style/index.less b/components/calendar/style/index.less index c8f68a3409..338c1cb0b0 100644 --- a/components/calendar/style/index.less +++ b/components/calendar/style/index.less @@ -42,9 +42,7 @@ .@{calendar-picker-prefix-cls}-body { padding: @padding-xs @padding-sm; } - } - .@{calendar-picker-prefix-cls}-panel { .@{calendar-picker-prefix-cls}-content { width: 100%; } diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index 61c0243dd9..715d3b5fe5 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -237,22 +237,15 @@ margin-left: @input-padding-horizontal-base * 1.5; transition: left @animation-duration-slow ease-out; - // .@{picker-prefix-cls}-time-range-wrapper & { - // display: none !important; - // } - &::after { position: absolute; - content: ''; - } - - &::after { top: @border-width-base; right: @border-width-base; width: @arrow-size; height: @arrow-size; border: @arrow-size / 2 solid @border-color-split; border-color: @calendar-bg @calendar-bg transparent transparent; + content: ''; } } diff --git a/components/date-picker/style/panel.less b/components/date-picker/style/panel.less index 99a6473eaa..a37d0c63df 100644 --- a/components/date-picker/style/panel.less +++ b/components/date-picker/style/panel.less @@ -380,14 +380,6 @@ } } - &-decade-panel { - .@{picker-prefix-cls}-cell { - &::before { - display: none; - } - } - } - // ======================== Footer ======================== &-footer { line-height: @picker-text-height - 2 * @border-width-base; @@ -434,6 +426,10 @@ .@{picker-cell-inner-cls} { padding: 0 (@padding-xs / 2); } + + .@{picker-prefix-cls}-cell::before { + display: none; + } } // ================== Year & Month Panel ================== diff --git a/components/table/style/index.less b/components/table/style/index.less index 8758949c8c..924484f46f 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -72,6 +72,8 @@ // ============================ Footer ============================ &-footer { padding: @table-padding-vertical @table-padding-horizontal; + color: @table-footer-color; + background: @table-footer-bg; } // ============================ Header ============================ @@ -123,6 +125,25 @@ } } } + + // ========================= Nest Table =========================== + .@{table-prefix-cls} { + margin: -@table-padding-vertical -@table-padding-horizontal -@table-padding-vertical (@table-padding-horizontal + + ceil(@font-size-sm * 1.4)); + + td { + background: transparent; + } + + tbody > tr:last-child > td { + border-bottom: 0; + + &:first-child, + &:last-child { + border-radius: 0; + } + } + } } } @@ -136,13 +157,6 @@ } } - // ============================ Footer ============================ - &-footer { - padding: @table-padding-vertical @table-padding-horizontal; - color: @table-footer-color; - background: @table-footer-bg; - } - // ========================== Pagination ========================== &-pagination.@{ant-prefix}-pagination { float: right; @@ -508,6 +522,7 @@ box-shadow: inset 10px 0 8px -8px darken(@shadow-color, 5%); } } + &-ping-right { &:not(.@{table-prefix-cls}-has-fix-right) .@{table-prefix-cls}-container { position: relative; @@ -521,70 +536,6 @@ box-shadow: inset -10px 0 8px -8px darken(@shadow-color, 5%); } } - - // ========================= Nest Table =========================== - tbody > tr > td { - .@{table-prefix-cls} { - margin: -@table-padding-vertical -@table-padding-horizontal -@table-padding-vertical (@table-padding-horizontal + - ceil(@font-size-sm * 1.4)); - - td { - background: transparent; - } - - tbody > tr:last-child > td { - border-bottom: 0; - - &:first-child, - &:last-child { - border-radius: 0; - } - } - } - } - - // ================================================================ - // = Border Radio = - // ================================================================ - - /* title + table */ - &-title { - border-radius: @table-border-radius-base @table-border-radius-base 0 0; - } - - &-title + &-container { - border-top-left-radius: 0; - border-top-right-radius: 0; - - table > thead > tr:first-child { - th:first-child { - border-radius: 0; - } - - th:last-child { - border-radius: 0; - } - } - } - - /* table */ - &-container { - border-top-left-radius: @table-border-radius-base; - border-top-right-radius: @table-border-radius-base; - - table > thead > tr:first-child { - th:first-child { - border-top-left-radius: @table-border-radius-base; - } - - th:last-child { - border-top-right-radius: @table-border-radius-base; - } - } - } - - /* table + footer */ - &-footer { - border-radius: 0 0 @table-border-radius-base @table-border-radius-base; - } } + +@import './radius.less'; diff --git a/components/table/style/radius.less b/components/table/style/radius.less new file mode 100644 index 0000000000..1927c1a069 --- /dev/null +++ b/components/table/style/radius.less @@ -0,0 +1,45 @@ +// ================================================================ +// = Border Radio = +// ================================================================ +.@{table-prefix-cls} { + /* title + table */ + &-title { + border-radius: @table-border-radius-base @table-border-radius-base 0 0; + } + + &-title + &-container { + border-top-left-radius: 0; + border-top-right-radius: 0; + + table > thead > tr:first-child { + th:first-child { + border-radius: 0; + } + + th:last-child { + border-radius: 0; + } + } + } + + /* table */ + &-container { + border-top-left-radius: @table-border-radius-base; + border-top-right-radius: @table-border-radius-base; + + table > thead > tr:first-child { + th:first-child { + border-top-left-radius: @table-border-radius-base; + } + + th:last-child { + border-top-right-radius: @table-border-radius-base; + } + } + } + + /* table + footer */ + &-footer { + border-radius: 0 0 @table-border-radius-base @table-border-radius-base; + } +}