File tree 3 files changed +29
-4
lines changed
test/test-cases/export-keyframes
3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -238,17 +238,26 @@ const plugin = (options = {}) => {
238
238
239
239
tokens = tokens . map ( ( token , idx ) => {
240
240
if ( idx === 0 || tokens [ idx - 1 ] === "," ) {
241
+ let result = token ;
242
+
241
243
const localMatch = / ^ ( \s * ) : l o c a l \s * \( ( .+ ?) \) / . exec ( token ) ;
244
+ const nextLocalMatch = / : l o c a l \s * \( ( .+ ?) \) / . exec ( token ) ;
242
245
243
246
if ( localMatch ) {
244
- return (
247
+ result =
245
248
localMatch [ 1 ] +
246
249
exportScopedName ( localMatch [ 2 ] ) +
247
- token . substr ( localMatch [ 0 ] . length )
248
- ) ;
250
+ token . substr ( localMatch [ 0 ] . length ) ;
251
+ } else if ( nextLocalMatch ) {
252
+ const input = nextLocalMatch . input ;
253
+ const matchPattern = nextLocalMatch [ 0 ] ;
254
+ const matchVal = nextLocalMatch [ 1 ] ;
255
+ const newVal = exportScopedName ( matchVal ) ;
256
+ result = input . replace ( matchPattern , newVal ) ;
249
257
} else {
250
- return token ;
258
+ // do nothing
251
259
}
260
+ return result ;
252
261
} else {
253
262
return token ;
254
263
}
Original file line number Diff line number Diff line change 17
17
animation-name : _input__fade-in;
18
18
}
19
19
20
+ ._input__fadeIn {
21
+ animation : 2s _input__fade-in;
22
+ }
23
+
24
+ ._input__fadeIn {
25
+ animation : _input__fade-in 2s ;
26
+ }
27
+
20
28
: export {
21
29
fadeIn : _input__fadeIn;
22
30
fade-in : _input__fade-in;
Original file line number Diff line number Diff line change 16
16
: local (.fadeIn ) {
17
17
animation-name : _colon_local (fade-in);
18
18
}
19
+
20
+ : local (.fadeIn ) {
21
+ animation : 2s _colon_local (fade-in);
22
+ }
23
+
24
+ : local (.fadeIn ) {
25
+ animation : _colon_local (fade-in) 2s ;
26
+ }
You can’t perform that action at this time.
0 commit comments