Skip to content

Commit 750c758

Browse files
unclechongunclechong
andauthored
fix: sass build warning (#1487)
Co-authored-by: unclechong <[email protected]>
1 parent 3364a36 commit 750c758

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

packages/taro-ui/src/components/flex/item/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
box-sizing: border-box;
1111

1212
@for $col from 1 through 12 {
13-
$width: ($col / 12) * 100%;
13+
$width: calc($col / 12) * 100%;
1414

1515
&-#{$col} {
1616
@include flex(0, 0, $width);

packages/taro-ui/src/style/components/avatar.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
width: $at-avatar-size-md;
66
height: $at-avatar-size-md;
77
color: $at-avatar-color;
8-
font-size: $at-avatar-size-md / 2.5;
8+
font-size: calc($at-avatar-size-md / 2.5);
99
line-height: $at-avatar-size-md;
1010
text-align: center;
1111
border-radius: $border-radius-md;
@@ -23,14 +23,14 @@
2323
&--large {
2424
width: $at-avatar-size-lg;
2525
height: $at-avatar-size-lg;
26-
font-size: $at-avatar-size-lg / 2.5;
26+
font-size: calc($at-avatar-size-lg / 2.5);
2727
line-height: $at-avatar-size-lg;
2828
}
2929

3030
&--small {
3131
width: $at-avatar-size-sm;
3232
height: $at-avatar-size-sm;
33-
font-size: $at-avatar-size-sm / 2.5;
33+
font-size: calc($at-avatar-size-sm / 2.5);
3434
line-height: $at-avatar-size-sm;
3535
}
3636

packages/taro-ui/src/style/components/button.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
}
8585

8686
&--circle {
87-
border-radius: $at-button-height / 2;
87+
border-radius: calc($at-button-height / 2);
8888
background-clip: border-box;
8989
overflow: hidden;
9090
}
@@ -99,7 +99,7 @@
9999
line-height: $at-button-height-sm - 2;
100100

101101
&.at-button--circle {
102-
border-radius: $at-button-height-sm / 2;
102+
border-radius: calc($at-button-height-sm / 2);
103103
}
104104
}
105105

packages/taro-ui/src/style/components/curtain.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $at-curtain-btn-size: 56px;
3636
position: absolute;
3737
width: $at-curtain-btn-size;
3838
height: $at-curtain-btn-size;
39-
margin-left: -$at-curtain-btn-size / 2;
39+
margin-left: calc(-$at-curtain-btn-size / 2);
4040
left: 50%;
4141
bottom: -($at-curtain-btn-size + 24px);
4242
align-items: center;
@@ -68,8 +68,8 @@ $at-curtain-btn-size: 56px;
6868
}
6969

7070
&--top {
71-
margin-left: -$at-curtain-btn-size / 2;
72-
top: -($at-curtain-btn-size + 24px);
71+
margin-left: calc(-$at-curtain-btn-size / 2);
72+
top: calc(-($at-curtain-btn-size + 24px));
7373
left: 50%;
7474
bottom: auto;
7575
}

packages/taro-ui/src/style/components/flex.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
box-sizing: border-box;
117117

118118
@for $col from 1 through 12 {
119-
$width: ($col / 12) * 100%;
119+
$width: calc(($col / 12) * 100%);
120120

121121
&-#{$col} {
122122
@include flex(0, 0, $width);

packages/taro-ui/src/style/components/progress.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
&-inner {
2727
width: 100%;
2828
background-color: $at-progress-inner-bg-color;
29-
border-radius: $at-progress-height / 2;
29+
border-radius: calc($at-progress-height / 2);
3030
vertical-align: middle;
3131

3232
&-background {
3333
position: relative;
3434
height: $at-progress-height;
35-
border-radius: $at-progress-height / 2;
35+
border-radius: calc($at-progress-height / 2);
3636
background-color: $at-progress-bar-bg-color;
3737
transition: all 0.3s $ease-in-out-quad;
3838
overflow: hidden;
@@ -62,7 +62,7 @@
6262
right: 0;
6363
bottom: 0;
6464
background: $at-progress-bar-bg-color-active;
65-
border-radius: $at-progress-height / 2;
65+
border-radius: calc($at-progress-height / 2);
6666
animation: progress-active 2s $ease-out-quad infinite;
6767
}
6868
}

packages/taro-ui/src/style/components/range.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
.at-range {
55
position: relative;
6-
padding: 0 $at-range-slider-size / 2 + 4PX;
6+
padding: 0 calc($at-range-slider-size / 2 + 4PX);
77
width: 100%;
88
box-sizing: border-box;
99

@@ -33,7 +33,7 @@
3333

3434
&__slider {
3535
position: absolute;
36-
margin-left: -$at-range-slider-size / 2;
36+
margin-left: calc(-$at-range-slider-size / 2);
3737
width: $at-range-slider-size;
3838
height: $at-range-slider-size;
3939
border-radius: 50%;

packages/taro-ui/src/style/components/search-bar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $at-search-bar-placholder-color: $color-grey-2;
2626
width: 100%;
2727
height: $at-search-bar-input-height;
2828
background-color: $at-search-bar-input-bg-color;
29-
border-radius: $at-search-bar-input-height / 2;
29+
border-radius: calc($at-search-bar-input-height / 2);
3030
overflow: hidden;
3131
display: flex;
3232
}

packages/taro-ui/src/style/components/tag.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $at-tag-border-size: 1PX;
4141
}
4242

4343
&--circle {
44-
border-radius: $at-tag-height / 2;
44+
border-radius: calc($at-tag-height / 2);
4545
background-clip: border-box;
4646
overflow: hidden;
4747
}
@@ -50,10 +50,10 @@ $at-tag-border-size: 1PX;
5050
padding: 0 $spacing-h-md;
5151
height: $at-tag-height-sm;
5252
font-size: $at-tag-font-size-sm;
53-
line-height: $at-tag-height-sm - 2px;
53+
line-height: calc($at-tag-height-sm - 2px);
5454

5555
&.at-tag--circle {
56-
border-radius: $at-tag-height-sm / 2;
56+
border-radius: calc($at-tag-height-sm / 2);
5757
}
5858
}
5959
}

packages/taro-ui/src/style/components/timeline.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565

6666
&__tail {
6767
position: absolute;
68-
top: $at-timeline-dot-size / 2;
69-
bottom: -$at-timeline-dot-size / 2;
70-
left: $at-timeline-dot-size / 2 - 2px;
68+
top: calc($at-timeline-dot-size / 2);
69+
bottom: calc(-$at-timeline-dot-size / 2);
70+
left: calc($at-timeline-dot-size / 2 - 2px);
7171
border-left: 1PX solid $at-timeline-line-color;
7272
}
7373

0 commit comments

Comments
 (0)