Skip to content

Commit cc9a7d5

Browse files
authored
Revert "Chore: replace node-sass with dart-sass (#21019)" (#21791)
This reverts commit d6dedac.
1 parent f109628 commit cc9a7d5

File tree

13 files changed

+2538
-2704
lines changed

13 files changed

+2538
-2704
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"gulp": "^4.0.0",
103103
"gulp-autoprefixer": "^6.0.0",
104104
"gulp-cssmin": "^0.2.0",
105-
"gulp-dart-sass": "^1.0.2",
105+
"gulp-sass": "^4.0.2",
106106
"highlight.js": "^9.3.0",
107107
"html-webpack-plugin": "^3.2.0",
108108
"json-loader": "^0.5.7",
@@ -121,12 +121,12 @@
121121
"markdown-it-container": "^2.0.0",
122122
"mini-css-extract-plugin": "^0.4.1",
123123
"mocha": "^6.0.2",
124+
"node-sass": "^4.11.0",
124125
"optimize-css-assets-webpack-plugin": "^5.0.1",
125126
"postcss": "^7.0.14",
126127
"progress-bar-webpack-plugin": "^1.11.0",
127128
"rimraf": "^2.5.4",
128-
"sass": "^1.34.0",
129-
"sass-loader": "^10.1.1",
129+
"sass-loader": "^7.1.0",
130130
"select-version-cli": "^0.0.2",
131131
"sinon": "^7.2.7",
132132
"sinon-chai": "^3.3.0",

packages/theme-chalk/gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use strict';
22

33
const { series, src, dest } = require('gulp');
4-
const sass = require('gulp-dart-sass');
4+
const sass = require('gulp-sass');
55
const autoprefixer = require('gulp-autoprefixer');
66
const cssmin = require('gulp-cssmin');
77

88
function compile() {
99
return src('./src/*.scss')
10-
.pipe(sass.sync().on('error', sass.logError))
10+
.pipe(sass.sync())
1111
.pipe(autoprefixer({
12-
overrideBrowserslist: ['ie > 9', 'last 2 versions'],
12+
browsers: ['ie > 9', 'last 2 versions'],
1313
cascade: false
1414
}))
1515
.pipe(cssmin())

packages/theme-chalk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"devDependencies": {
2929
"gulp": "^3.9.1",
3030
"gulp-cssmin": "^0.1.7",
31-
"gulp-dart-sass": "^1.0.2",
31+
"gulp-sass": "^3.1.0",
3232
"gulp-autoprefixer": "^4.0.0"
3333
},
3434
"dependencies": {}

packages/theme-chalk/src/badge.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
@import "mixins/mixins";
32
@import "common/var";
43

@@ -23,7 +22,7 @@
2322
@include when(fixed) {
2423
position: absolute;
2524
top: 0;
26-
right: #{1 + math.div($--badge-size, 2)};
25+
right: #{1 + $--badge-size / 2};
2726
transform: translateY(-50%) translateX(100%);
2827

2928
@include when(dot) {

packages/theme-chalk/src/carousel.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
@import "mixins/mixins";
32
@import "common/var";
43

@@ -123,7 +122,7 @@
123122
padding: $--carousel-indicator-padding-horizontal $--carousel-indicator-padding-vertical;
124123
.el-carousel__button {
125124
width: $--carousel-indicator-height;
126-
height: #{math.div($--carousel-indicator-width, 2)};
125+
height: #{$--carousel-indicator-width / 2};
127126
}
128127
}
129128

packages/theme-chalk/src/col.scss

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
@import "./common/var.scss";
32
@import "./mixins/mixins.scss";
43

@@ -13,21 +12,21 @@
1312

1413
@for $i from 0 through 24 {
1514
.el-col-#{$i} {
16-
width: (math.div(1 , 24) * $i * 100) * 1%;
15+
width: (1 / 24 * $i * 100) * 1%;
1716
}
1817

1918
.el-col-offset-#{$i} {
20-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
19+
margin-left: (1 / 24 * $i * 100) * 1%;
2120
}
2221

2322
.el-col-pull-#{$i} {
2423
position: relative;
25-
right: (math.div(1 , 24) * $i * 100) * 1%;
24+
right: (1 / 24 * $i * 100) * 1%;
2625
}
2726

2827
.el-col-push-#{$i} {
2928
position: relative;
30-
left: (math.div(1 , 24) * $i * 100) * 1%;
29+
left: (1 / 24 * $i * 100) * 1%;
3130
}
3231
}
3332

@@ -37,21 +36,21 @@
3736
}
3837
@for $i from 0 through 24 {
3938
.el-col-xs-#{$i} {
40-
width: (math.div(1 , 24) * $i * 100) * 1%;
39+
width: (1 / 24 * $i * 100) * 1%;
4140
}
4241

4342
.el-col-xs-offset-#{$i} {
44-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
43+
margin-left: (1 / 24 * $i * 100) * 1%;
4544
}
4645

4746
.el-col-xs-pull-#{$i} {
4847
position: relative;
49-
right: (math.div(1 , 24) * $i * 100) * 1%;
48+
right: (1 / 24 * $i * 100) * 1%;
5049
}
5150

5251
.el-col-xs-push-#{$i} {
5352
position: relative;
54-
left: (math.div(1 , 24) * $i * 100) * 1%;
53+
left: (1 / 24 * $i * 100) * 1%;
5554
}
5655
}
5756
}
@@ -62,21 +61,21 @@
6261
}
6362
@for $i from 0 through 24 {
6463
.el-col-sm-#{$i} {
65-
width: (math.div(1 , 24) * $i * 100) * 1%;
64+
width: (1 / 24 * $i * 100) * 1%;
6665
}
6766

6867
.el-col-sm-offset-#{$i} {
69-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
68+
margin-left: (1 / 24 * $i * 100) * 1%;
7069
}
7170

7271
.el-col-sm-pull-#{$i} {
7372
position: relative;
74-
right: (math.div(1 , 24) * $i * 100) * 1%;
73+
right: (1 / 24 * $i * 100) * 1%;
7574
}
7675

7776
.el-col-sm-push-#{$i} {
7877
position: relative;
79-
left: (math.div(1 , 24) * $i * 100) * 1%;
78+
left: (1 / 24 * $i * 100) * 1%;
8079
}
8180
}
8281
}
@@ -87,21 +86,21 @@
8786
}
8887
@for $i from 0 through 24 {
8988
.el-col-md-#{$i} {
90-
width: (math.div(1 , 24) * $i * 100) * 1%;
89+
width: (1 / 24 * $i * 100) * 1%;
9190
}
9291

9392
.el-col-md-offset-#{$i} {
94-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
93+
margin-left: (1 / 24 * $i * 100) * 1%;
9594
}
9695

9796
.el-col-md-pull-#{$i} {
9897
position: relative;
99-
right: (math.div(1 , 24) * $i * 100) * 1%;
98+
right: (1 / 24 * $i * 100) * 1%;
10099
}
101100

102101
.el-col-md-push-#{$i} {
103102
position: relative;
104-
left: (math.div(1 , 24) * $i * 100) * 1%;
103+
left: (1 / 24 * $i * 100) * 1%;
105104
}
106105
}
107106
}
@@ -112,21 +111,21 @@
112111
}
113112
@for $i from 0 through 24 {
114113
.el-col-lg-#{$i} {
115-
width: (math.div(1 , 24) * $i * 100) * 1%;
114+
width: (1 / 24 * $i * 100) * 1%;
116115
}
117116

118117
.el-col-lg-offset-#{$i} {
119-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
118+
margin-left: (1 / 24 * $i * 100) * 1%;
120119
}
121120

122121
.el-col-lg-pull-#{$i} {
123122
position: relative;
124-
right: (math.div(1 , 24) * $i * 100) * 1%;
123+
right: (1 / 24 * $i * 100) * 1%;
125124
}
126125

127126
.el-col-lg-push-#{$i} {
128127
position: relative;
129-
left: (math.div(1 , 24) * $i * 100) * 1%;
128+
left: (1 / 24 * $i * 100) * 1%;
130129
}
131130
}
132131
}
@@ -137,21 +136,21 @@
137136
}
138137
@for $i from 0 through 24 {
139138
.el-col-xl-#{$i} {
140-
width: (math.div(1 , 24) * $i * 100) * 1%;
139+
width: (1 / 24 * $i * 100) * 1%;
141140
}
142141

143142
.el-col-xl-offset-#{$i} {
144-
margin-left: (math.div(1 , 24) * $i * 100) * 1%;
143+
margin-left: (1 / 24 * $i * 100) * 1%;
145144
}
146145

147146
.el-col-xl-pull-#{$i} {
148147
position: relative;
149-
right: (math.div(1 , 24) * $i * 100) * 1%;
148+
right: (1 / 24 * $i * 100) * 1%;
150149
}
151150

152151
.el-col-xl-push-#{$i} {
153152
position: relative;
154-
left: (math.div(1 , 24) * $i * 100) * 1%;
153+
left: (1 / 24 * $i * 100) * 1%;
155154
}
156155
}
157156
}

packages/theme-chalk/src/common/var.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
/* Element Chalk Variables */
32

43
// Special comment for theme configurator
@@ -487,7 +486,7 @@ $--cascader-tag-background: #f0f2f5;
487486

488487
/* Group
489488
-------------------------- */
490-
$--group-option-flex: 0 0 math.div(1, 5) * 100% !default;
489+
$--group-option-flex: 0 0 (1/5) * 100% !default;
491490
$--group-option-offset-bottom: 12px !default;
492491
$--group-option-fill-hover: rgba($--color-black, 0.06) !default;
493492
$--group-title-color: $--color-black !default;

packages/theme-chalk/src/input-number.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
@import "mixins/mixins";
32
@import "common/var";
43
@import "input";
@@ -138,7 +137,7 @@
138137

139138
@include e((increase, decrease)) {
140139
height: auto;
141-
line-height: #{math.div($--input-height - 2, 2)};
140+
line-height: #{($--input-height - 2) / 2};
142141

143142
[class*=el-icon] {
144143
transform: scale(.8);
@@ -162,19 +161,19 @@
162161

163162
&[class*=medium] {
164163
[class*=increase], [class*=decrease] {
165-
line-height: #{math.div($--input-medium-height - 2, 2)};
164+
line-height: #{($--input-medium-height - 2) / 2};
166165
}
167166
}
168167

169168
&[class*=small] {
170169
[class*=increase], [class*=decrease] {
171-
line-height: #{math.div($--input-small-height - 2, 2)};
170+
line-height: #{($--input-small-height - 2) / 2};
172171
}
173172
}
174173

175174
&[class*=mini] {
176175
[class*=increase], [class*=decrease] {
177-
line-height: #{math.div($--input-mini-height - 2, 2)};
176+
line-height: #{($--input-mini-height - 2) / 2};
178177
}
179178
}
180179
}

packages/theme-chalk/src/loading.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "sass:math";
21
@import "mixins/mixins";
32
@import "common/var";
43

@@ -27,7 +26,7 @@
2726
position: fixed;
2827

2928
.el-loading-spinner {
30-
margin-top: #{math.div(-$--loading-fullscreen-spinner-size, 2)};
29+
margin-top: #{- $--loading-fullscreen-spinner-size / 2};
3130

3231
.circular {
3332
height: $--loading-fullscreen-spinner-size;
@@ -39,7 +38,7 @@
3938

4039
@include b(loading-spinner) {
4140
top: 50%;
42-
margin-top: #{math.div(-$--loading-spinner-size, 2)};
41+
margin-top: #{- $--loading-spinner-size / 2};
4342
width: 100%;
4443
text-align: center;
4544
position: absolute;

packages/theme-chalk/src/mixins/mixins.scss

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@
66
@mixin res($key, $map: $--breakpoints) {
77
// 循环断点Map,如果存在则返回
88
@if map-has-key($map, $key) {
9-
@if $key=='sm-only'or $key=='md-only'or $key=='lg-only' {
10-
// 判定特定定义处理字符串参数值问题
11-
@media only screen and #{unquote(map-get($map, $key))} {
12-
@content;
13-
}
14-
}
15-
16-
@else {
17-
@media only screen and #{inspect(map-get($map, $key))} {
18-
@content;
19-
}
9+
@media only screen and #{inspect(map-get($map, $key))} {
10+
@content;
2011
}
2112
} @else {
2213
@warn "Undefeined points: `#{$map}`";

0 commit comments

Comments
 (0)