Skip to content

Commit 3c1a444

Browse files
committed
chore: support less4
1 parent c90afee commit 3c1a444

File tree

71 files changed

+510
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+510
-491
lines changed

.stylelintrc.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": [
3+
"stylelint-config-standard",
4+
"stylelint-config-rational-order",
5+
"stylelint-config-prettier"
6+
],
7+
"plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"],
8+
"rules": {
9+
"comment-empty-line-before": null,
10+
"function-name-case": ["lower", { "ignoreFunctions": ["/colorPalette/"] }],
11+
"no-invalid-double-slash-comments": null,
12+
"no-descending-specificity": null,
13+
"declaration-empty-line-before": null
14+
},
15+
"ignoreFiles": ["components/style/color/{bezierEasing,colorPalette,tinyColor}.less"]
16+
}

antdv-demo

components/alert/style/index.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@alert-close-hover-color: @icon-color-hover;
1010

1111
.@{alert-prefix-cls} {
12-
.reset-component;
12+
.reset-component();
1313

1414
position: relative;
1515
padding: 8px 15px 8px 37px;
@@ -26,7 +26,7 @@
2626

2727
&-icon {
2828
position: absolute;
29-
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
29+
top: 8px + (@font-size-base * @line-height-base / 2) - (@font-size-base / 2);
3030
left: 16px;
3131
}
3232

components/anchor/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@anchor-border-width: 2px;
55

66
.@{ant-prefix}-anchor {
7-
.reset-component;
7+
.reset-component();
88

99
position: relative;
1010
padding-left: @anchor-border-width;

components/auto-complete/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@autocomplete-prefix-cls: ~'@{select-prefix-cls}-auto-complete';
88

99
.@{autocomplete-prefix-cls} {
10-
.reset-component;
10+
.reset-component();
1111

1212
// https://github.com/ant-design/ant-design/issues/22302
1313
.@{select-prefix-cls}-clear {

components/avatar/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@avatar-prefix-cls: ~'@{ant-prefix}-avatar';
55

66
.@{avatar-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
position: relative;
1010
display: inline-block;

components/back-top/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@backtop-prefix-cls: ~'@{ant-prefix}-back-top';
55

66
.@{backtop-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
position: fixed;
1010
right: 100px;

components/badge/style/index.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
66

77
.@{badge-prefix-cls} {
8-
.reset-component;
8+
.reset-component();
99

1010
position: relative;
1111
display: inline-block;
@@ -23,7 +23,7 @@
2323
white-space: nowrap;
2424
text-align: center;
2525
background: @highlight-color;
26-
border-radius: @badge-height / 2;
26+
border-radius: (@badge-height / 2);
2727
box-shadow: 0 0 0 1px @shadow-color-inverse;
2828
a,
2929
a:hover {

components/breadcrumb/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
55

66
.@{breadcrumb-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
color: @breadcrumb-base-color;
1010
font-size: @breadcrumb-font-size;

components/button/style/index.less

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// It is a render problem of chrome, which is only happened in the codesandbox demo
2222
// 0.001px solution works and I don't why
2323
line-height: @line-height-base;
24-
.btn;
25-
.btn-default;
24+
.btn();
25+
.btn-default();
2626

2727
// Make sure that the target of Button's click event always be `button`
2828
// Ref: https://github.com/ant-design/ant-design/issues/7034
@@ -34,7 +34,7 @@
3434
}
3535

3636
&-primary {
37-
.btn-primary;
37+
.btn-primary();
3838

3939
.@{btn-prefix-cls}-group &:not(:first-child):not(:last-child) {
4040
border-right-color: @btn-group-border;
@@ -64,19 +64,19 @@
6464
}
6565

6666
&-ghost {
67-
.btn-ghost;
67+
.btn-ghost();
6868
}
6969

7070
&-dashed {
71-
.btn-dashed;
71+
.btn-dashed();
7272
}
7373

7474
&-danger {
75-
.btn-danger;
75+
.btn-danger();
7676
}
7777

7878
&-link {
79-
.btn-link;
79+
.btn-link();
8080
}
8181

8282
&-icon-only {

components/button/style/mixin.less

+3-3
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@
238238
}
239239
// round button
240240
.btn-round(@btnClassName: btn) {
241-
.button-size(@btn-circle-size; 0 @btn-circle-size / 2; @font-size-base; @btn-circle-size);
241+
.button-size(@btn-circle-size; 0 (@btn-circle-size / 2) ; @font-size-base; @btn-circle-size);
242242
&.@{btnClassName}-lg {
243243
.button-size(
244-
@btn-circle-size-lg; 0 @btn-circle-size-lg / 2; @btn-font-size-lg; @btn-circle-size-lg
244+
@btn-circle-size-lg; 0 (@btn-circle-size-lg / 2) ; @btn-font-size-lg; @btn-circle-size-lg
245245
);
246246
}
247247
&.@{btnClassName}-sm {
248248
.button-size(
249-
@btn-circle-size-sm; 0 @btn-circle-size-sm / 2; @font-size-base; @btn-circle-size-sm
249+
@btn-circle-size-sm; 0 (@btn-circle-size-sm / 2) ; @font-size-base; @btn-circle-size-sm
250250
);
251251
}
252252
}

components/calendar/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@full-calendar-prefix-cls: ~'@{ant-prefix}-fullcalendar';
55

66
.@{full-calendar-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
border-top: @border-width-base @border-style-base @border-color-base;
1010
outline: none;

components/card/style/index.less

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@gradient-max: fade(@card-skeleton-bg, 40%);
1111

1212
.@{card-prefix-cls} {
13-
.reset-component;
13+
.reset-component();
1414

1515
position: relative;
1616
background: @card-background;
@@ -39,7 +39,7 @@
3939
background: @card-head-background;
4040
border-bottom: @border-width-base @border-style-base @border-color-split;
4141
border-radius: @card-radius @card-radius 0 0;
42-
.clearfix;
42+
.clearfix();
4343

4444
&-wrapper {
4545
display: flex;
@@ -80,7 +80,7 @@
8080

8181
&-body {
8282
padding: @card-padding-base;
83-
.clearfix;
83+
.clearfix();
8484
}
8585

8686
&-contain-grid:not(&-loading) &-body {
@@ -132,7 +132,7 @@
132132
list-style: none;
133133
background: @card-actions-background;
134134
border-top: @border-width-base @border-style-base @border-color-split;
135-
.clearfix;
135+
.clearfix();
136136

137137
& > li {
138138
float: left;
@@ -198,7 +198,7 @@
198198

199199
&-meta {
200200
margin: -4px 0;
201-
.clearfix;
201+
.clearfix();
202202

203203
&-avatar {
204204
float: left;

components/card/style/size.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@card-head-height-sm: 36px;
2-
@card-padding-base-sm: @card-padding-base / 2;
3-
@card-head-padding-sm: @card-head-padding / 2;
2+
@card-padding-base-sm: (@card-padding-base / 2);
3+
@card-head-padding-sm: (@card-head-padding / 2);
44
@card-head-font-size-sm: @font-size-base;
55

66
.@{card-prefix-cls}-small {

components/carousel/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import '../../style/mixins/index';
33

44
.@{ant-prefix}-carousel {
5-
.reset-component;
5+
.reset-component();
66

77
.slick-slider {
88
position: relative;

components/cascader/style/index.less

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@cascader-prefix-cls: ~'@{ant-prefix}-cascader';
66

77
.@{cascader-prefix-cls} {
8-
.reset-component;
8+
.reset-component();
99

1010
&-input.@{ant-prefix}-input {
1111
// Keep it static for https://github.com/ant-design/ant-design/issues/16738
@@ -24,7 +24,7 @@
2424
}
2525

2626
&-picker {
27-
.reset-component;
27+
.reset-component();
2828

2929
position: relative;
3030
display: inline-block;
@@ -48,7 +48,7 @@
4848
}
4949

5050
&:focus .@{cascader-prefix-cls}-input {
51-
.active;
51+
.active();
5252
}
5353

5454
&-show-search&-focused {
@@ -114,7 +114,7 @@
114114

115115
// https://github.com/ant-design/ant-design/pull/12407#issuecomment-424657810
116116
&-picker-label:hover + &-input {
117-
.hover;
117+
.hover();
118118
}
119119

120120
&-picker-small &-picker-clear,

components/checkbox/style/mixin.less

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@checkbox-inner-prefix-cls: ~'@{checkbox-prefix-cls}-inner';
55
// 一般状态
66
.@{checkbox-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
position: relative;
1010
top: -0.09em;
@@ -146,7 +146,7 @@
146146
}
147147

148148
.@{checkbox-prefix-cls}-wrapper {
149-
.reset-component;
149+
.reset-component();
150150

151151
display: inline-block;
152152
line-height: unset;
@@ -165,7 +165,7 @@
165165
}
166166

167167
.@{checkbox-prefix-cls}-group {
168-
.reset-component;
168+
.reset-component();
169169

170170
display: inline-block;
171171
&-item {

components/collapse/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@collapse-prefix-cls: ~'@{ant-prefix}-collapse';
55

66
.@{collapse-prefix-cls} {
7-
.reset-component;
7+
.reset-component();
88

99
background-color: @collapse-header-bg;
1010
border: @border-width-base @border-style-base @border-color-base;

components/color-picker/style/index.less

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@
7575
height: @input-height-base;
7676
cursor: inherit;
7777
&:hover {
78-
.hover;
78+
.hover();
7979
}
8080
}
8181
&-icon {
8282
.iconfont-mixin();
8383
position: absolute;
8484
top: 50%;
8585
right: @control-padding-horizontal - 4px;
86-
margin-top: -@font-size-sm / 2;
86+
margin-top: (-@font-size-sm / 2);
8787
color: @disabled-color;
8888
font-size: @font-size-sm;
8989
line-height: 1;
@@ -99,7 +99,7 @@
9999
height: @input-height-lg;
100100
}
101101
.@{color-picker-prefix-cls}-icon {
102-
top: @input-height-lg / 2;
102+
top: (@input-height-lg / 2);
103103
}
104104
}
105105

@@ -114,7 +114,7 @@
114114
}
115115
.@{color-picker-prefix-cls}-icon {
116116
right: @control-padding-horizontal - 2px;
117-
top: @input-height-sm / 2;
117+
top: (@input-height-sm / 2);
118118
font-size: 10px;
119119
}
120120
}

0 commit comments

Comments
 (0)