fix: lint:style

This commit is contained in:
orzyyyy 2019-08-02 18:21:24 +08:00
parent 872ada07e7
commit 649e8127c5
4 changed files with 63 additions and 52 deletions

View File

@ -61,9 +61,9 @@
} }
.@{ant-prefix}-col { .@{ant-prefix}-col {
position: relative;
// Prevent columns from collapsing when empty // Prevent columns from collapsing when empty
min-height: 1px; min-height: 1px;
position: relative;
} }
.make-grid-columns(); .make-grid-columns();

View File

@ -10,20 +10,20 @@
padding: @input-padding-vertical-lg @input-padding-horizontal-lg; padding: @input-padding-vertical-lg @input-padding-horizontal-lg;
font-size: @font-size-lg; font-size: @font-size-lg;
line-height: @input-height-lg; line-height: @input-height-lg;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753 line-height:~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
} }
.input-sm() { .input-sm() {
height: @input-height-sm; height: @input-height-sm;
padding: @input-padding-vertical-sm @input-padding-horizontal-sm; padding: @input-padding-vertical-sm @input-padding-horizontal-sm;
line-height: @input-height-sm; line-height: @input-height-sm;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753 line-height:~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
} }
// input status // input status
// == when focus or actived // == when focus or actived
.active(@color: @outline-color) { .active(@color: @outline-color) {
border-color: ~`colorPalette('@{color}', 5) `; border-color:~`colorPalette('@{color}', 5) `;
border-right-width: @border-width-base !important; border-right-width: @border-width-base !important;
outline: 0; 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, 20%);
@ -40,6 +40,7 @@
background-color: @input-disabled-bg; background-color: @input-disabled-bg;
cursor: not-allowed; cursor: not-allowed;
opacity: 1; opacity: 1;
&:hover { &:hover {
.hover(@input-border-color); .hover(@input-border-color);
} }
@ -55,7 +56,7 @@
color: @input-color; color: @input-color;
font-size: @font-size-base; font-size: @font-size-base;
line-height: @input-height-base; line-height: @input-height-base;
line-height: ~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753 line-height:~'@{line-height-base} \9'; // https://github.com/ant-design/ant-design/issues/17753
background-color: @input-bg; background-color: @input-bg;
background-image: none; background-image: none;
border: @border-width-base @border-style-base @input-border-color; border: @border-width-base @border-style-base @input-border-color;
@ -114,8 +115,9 @@
padding-left: 0; padding-left: 0;
} }
> [class*='col-'] { >[class*='col-'] {
padding-right: 8px; padding-right: 8px;
&:last-child { &:last-child {
padding-right: 0; padding-right: 0;
} }
@ -123,7 +125,7 @@
&-addon, &-addon,
&-wrap, &-wrap,
> .@{inputClass} { >.@{inputClass} {
display: table-cell; display: table-cell;
&:not(:first-child):not(:last-child) { &:not(:first-child):not(:last-child) {
@ -138,7 +140,7 @@
vertical-align: middle; vertical-align: middle;
} }
&-wrap > * { &-wrap>* {
display: block !important; display: block !important;
} }
@ -147,10 +149,12 @@
width: 100%; width: 100%;
margin-bottom: 0; margin-bottom: 0;
text-align: inherit; text-align: inherit;
&:focus { &:focus {
z-index: 1; // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png z-index: 1; // Fix https://gw.alipayobjects.com/zos/rmsportal/DHNpoqfMXSfrSnlZvhsJ.png
border-right-width: 1px; border-right-width: 1px;
} }
&:hover { &:hover {
z-index: 1; z-index: 1;
border-right-width: 1px; border-right-width: 1px;
@ -191,7 +195,7 @@
// Expand addon icon click area // Expand addon icon click area
// https://github.com/ant-design/ant-design/issues/3714 // https://github.com/ant-design/ant-design/issues/3714
> i:only-child::after { >i:only-child::after {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
@ -202,7 +206,7 @@
} }
// Reset rounded corners // Reset rounded corners
> .@{inputClass}:first-child, >.@{inputClass}:first-child,
&-addon:first-child { &-addon:first-child {
border-top-right-radius: 0; border-top-right-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
@ -214,7 +218,7 @@
} }
} }
> .@{inputClass}-affix-wrapper { >.@{inputClass}-affix-wrapper {
&:not(:first-child) .@{inputClass} { &:not(:first-child) .@{inputClass} {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
@ -229,11 +233,12 @@
&-addon:first-child { &-addon:first-child {
border-right: 0; border-right: 0;
} }
&-addon:last-child { &-addon:last-child {
border-left: 0; border-left: 0;
} }
> .@{inputClass}:last-child, >.@{inputClass}:last-child,
&-addon:last-child { &-addon:last-child {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
@ -247,12 +252,12 @@
// Sizing options // Sizing options
&-lg .@{inputClass}, &-lg .@{inputClass},
&-lg > &-addon { &-lg>&-addon {
.input-lg(); .input-lg();
} }
&-sm .@{inputClass}, &-sm .@{inputClass},
&-sm > &-addon { &-sm>&-addon {
.input-sm(); .input-sm();
} }
@ -277,26 +282,28 @@
&-addon, &-addon,
&-wrap, &-wrap,
> .@{inputClass} { >.@{inputClass} {
&:not(:first-child):not(:last-child) { &:not(:first-child):not(:last-child) {
border-right-width: @border-width-base; border-right-width: @border-width-base;
&:hover { &:hover {
z-index: 1; z-index: 1;
} }
&:focus { &:focus {
z-index: 1; z-index: 1;
} }
} }
} }
& > * { &>* {
display: inline-block; display: inline-block;
float: none; float: none;
vertical-align: top; // https://github.com/ant-design/ant-design-pro/issues/139 vertical-align: top; // https://github.com/ant-design/ant-design-pro/issues/139
border-radius: 0; border-radius: 0;
} }
& > *:not(:last-child) { &>*:not(:last-child) {
margin-right: -@border-width-base; margin-right: -@border-width-base;
border-right-width: @border-width-base; border-right-width: @border-width-base;
} }
@ -307,48 +314,50 @@
} }
// reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker // reset border for Select, DatePicker, AutoComplete, Cascader, Mention, TimePicker
& > .@{ant-prefix}-select > .@{ant-prefix}-select-selection, &>.@{ant-prefix}-select>.@{ant-prefix}-select-selection,
& > .@{ant-prefix}-calendar-picker .@{ant-prefix}-input, &>.@{ant-prefix}-calendar-picker .@{ant-prefix}-input,
& > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input, &>.@{ant-prefix}-select-auto-complete .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker .@{ant-prefix}-input, &>.@{ant-prefix}-cascader-picker .@{ant-prefix}-input,
& > .@{ant-prefix}-mention-wrapper .@{ant-prefix}-mention-editor, &>.@{ant-prefix}-mention-wrapper .@{ant-prefix}-mention-editor,
& > .@{ant-prefix}-time-picker .@{ant-prefix}-time-picker-input { &>.@{ant-prefix}-time-picker .@{ant-prefix}-time-picker-input {
border-right-width: @border-width-base; border-right-width: @border-width-base;
border-radius: 0; border-radius: 0;
&:hover { &:hover {
z-index: 1; z-index: 1;
} }
&:focus { &:focus {
z-index: 1; z-index: 1;
} }
} }
& > *:first-child, &>*:first-child,
& > .@{ant-prefix}-select:first-child > .@{ant-prefix}-select-selection, &>.@{ant-prefix}-select:first-child>.@{ant-prefix}-select-selection,
& > .@{ant-prefix}-calendar-picker:first-child .@{ant-prefix}-input, &>.@{ant-prefix}-calendar-picker:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input, &>.@{ant-prefix}-select-auto-complete:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input, &>.@{ant-prefix}-cascader-picker:first-child .@{ant-prefix}-input,
& > .@{ant-prefix}-mention-wrapper:first-child .@{ant-prefix}-mention-editor, &>.@{ant-prefix}-mention-wrapper:first-child .@{ant-prefix}-mention-editor,
& > .@{ant-prefix}-time-picker:first-child .@{ant-prefix}-time-picker-input { &>.@{ant-prefix}-time-picker:first-child .@{ant-prefix}-time-picker-input {
border-top-left-radius: @border-radius-base; border-top-left-radius: @border-radius-base;
border-bottom-left-radius: @border-radius-base; border-bottom-left-radius: @border-radius-base;
} }
& > *:last-child, &>*:last-child,
& > .@{ant-prefix}-select:last-child > .@{ant-prefix}-select-selection, &>.@{ant-prefix}-select:last-child>.@{ant-prefix}-select-selection,
& > .@{ant-prefix}-calendar-picker:last-child .@{ant-prefix}-input, &>.@{ant-prefix}-calendar-picker:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input, &>.@{ant-prefix}-select-auto-complete:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input, &>.@{ant-prefix}-cascader-picker:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input, &>.@{ant-prefix}-cascader-picker-focused:last-child .@{ant-prefix}-input,
& > .@{ant-prefix}-mention-wrapper:last-child .@{ant-prefix}-mention-editor, &>.@{ant-prefix}-mention-wrapper:last-child .@{ant-prefix}-mention-editor,
& > .@{ant-prefix}-time-picker:last-child .@{ant-prefix}-time-picker-input { &>.@{ant-prefix}-time-picker:last-child .@{ant-prefix}-time-picker-input {
border-right-width: @border-width-base; border-right-width: @border-width-base;
border-top-right-radius: @border-radius-base; border-top-right-radius: @border-radius-base;
border-bottom-right-radius: @border-radius-base; border-bottom-right-radius: @border-radius-base;
} }
// https://github.com/ant-design/ant-design/issues/12493 // https://github.com/ant-design/ant-design/issues/12493
& > .@{ant-prefix}-select-auto-complete .@{ant-prefix}-input { &>.@{ant-prefix}-select-auto-complete .@{ant-prefix}-input {
vertical-align: top; vertical-align: top;
} }
} }
@ -383,6 +392,7 @@
color: @input-color; color: @input-color;
line-height: 0; line-height: 0;
transform: translateY(-50%); transform: translateY(-50%);
:not(.anticon) { :not(.anticon) {
line-height: @line-height-base; line-height: @line-height-base;
} }
@ -403,6 +413,7 @@
.@{inputClass}:not(:last-child) { .@{inputClass}:not(:last-child) {
padding-right: @input-padding-horizontal-base + @input-affix-width; padding-right: @input-padding-horizontal-base + @input-affix-width;
} }
&.@{inputClass}-affix-wrapper-with-clear-btn .@{inputClass}:not(:last-child) { &.@{inputClass}-affix-wrapper-with-clear-btn .@{inputClass}:not(:last-child) {
padding-right: @input-padding-horizontal-base + @input-affix-with-clear-btn-width; padding-right: @input-padding-horizontal-base + @input-affix-with-clear-btn-width;
} }

View File

@ -34,10 +34,10 @@
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
overflow: hidden;
vertical-align: middle; vertical-align: middle;
background-color: @progress-remaining-color; background-color: @progress-remaining-color;
border-radius: @progress-radius; border-radius: @progress-radius;
overflow: hidden;
} }
&-circle-trail { &-circle-trail {

View File

@ -69,22 +69,22 @@
display: block; display: block;
width: @tooltip-arrow-rotate-width; width: @tooltip-arrow-rotate-width;
height: @tooltip-arrow-rotate-width; height: @tooltip-arrow-rotate-width;
background: transparent;
overflow: hidden; overflow: hidden;
background: transparent;
pointer-events: none; pointer-events: none;
&::before { &::before {
width: @tooltip-arrow-width; position: absolute;
height: @tooltip-arrow-width;
content: '';
display: block;
margin: auto;
top: 0; top: 0;
right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; display: block;
width: @tooltip-arrow-width;
height: @tooltip-arrow-width;
margin: auto;
background-color: @tooltip-bg; background-color: @tooltip-bg;
position: absolute; content: '';
pointer-events: auto; pointer-events: auto;
} }
} }
@ -95,8 +95,8 @@
bottom: @tooltip-distance - @tooltip-arrow-rotate-width; bottom: @tooltip-distance - @tooltip-arrow-rotate-width;
&::before { &::before {
transform: translateY(-@tooltip-arrow-rotate-width / 2) rotate(45deg);
box-shadow: @tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%); box-shadow: @tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
transform: translateY(-@tooltip-arrow-rotate-width / 2) rotate(45deg);
} }
} }
@ -119,8 +119,8 @@
left: @tooltip-distance - @tooltip-arrow-rotate-width; left: @tooltip-distance - @tooltip-arrow-rotate-width;
&::before { &::before {
transform: translateX(@tooltip-arrow-rotate-width / 2) rotate(45deg);
box-shadow: -@tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%); box-shadow: -@tooltip-arrow-shadow-width @tooltip-arrow-shadow-width 7px fade(@black, 7%);
transform: translateX(@tooltip-arrow-rotate-width / 2) rotate(45deg);
} }
} }
@ -143,8 +143,8 @@
right: @tooltip-distance - @tooltip-arrow-rotate-width; right: @tooltip-distance - @tooltip-arrow-rotate-width;
&::before { &::before {
transform: translateX(-@tooltip-arrow-rotate-width / 2) rotate(45deg);
box-shadow: @tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%); box-shadow: @tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
transform: translateX(-@tooltip-arrow-rotate-width / 2) rotate(45deg);
} }
} }
@ -167,8 +167,8 @@
top: @tooltip-distance - @tooltip-arrow-rotate-width; top: @tooltip-distance - @tooltip-arrow-rotate-width;
&::before { &::before {
transform: translateY(@tooltip-arrow-rotate-width / 2) rotate(45deg);
box-shadow: -@tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%); box-shadow: -@tooltip-arrow-shadow-width -@tooltip-arrow-shadow-width 7px fade(@black, 7%);
transform: translateY(@tooltip-arrow-rotate-width / 2) rotate(45deg);
} }
} }