File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/compiler-sfc/src/style Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { warn } from '../warn'
10
10
11
11
const animationNameRE = / ^ ( - \w + - ) ? a n i m a t i o n - n a m e $ /
12
12
const animationRE = / ^ ( - \w + - ) ? a n i m a t i o n $ /
13
+ const keyframesRE = / ^ (?: - \w + - ) ? k e y f r a m e s $ /
13
14
14
15
const scopedPlugin : PluginCreator < string > = ( id = '' ) => {
15
16
const keyframes = Object . create ( null )
@@ -21,10 +22,7 @@ const scopedPlugin: PluginCreator<string> = (id = '') => {
21
22
processRule ( id , rule )
22
23
} ,
23
24
AtRule ( node ) {
24
- if (
25
- / - ? k e y f r a m e s $ / . test ( node . name ) &&
26
- ! node . params . endsWith ( `-${ shortId } ` )
27
- ) {
25
+ if ( keyframesRE . test ( node . name ) && ! node . params . endsWith ( `-${ shortId } ` ) ) {
28
26
// register keyframes
29
27
keyframes [ node . params ] = node . params = node . params + '-' + shortId
30
28
}
@@ -72,7 +70,7 @@ function processRule(id: string, rule: Rule) {
72
70
processedRules . has ( rule ) ||
73
71
( rule . parent &&
74
72
rule . parent . type === 'atrule' &&
75
- / - ? k e y f r a m e s $ / . test ( ( rule . parent as AtRule ) . name ) )
73
+ keyframesRE . test ( ( rule . parent as AtRule ) . name ) )
76
74
) {
77
75
return
78
76
}
You can’t perform that action at this time.
0 commit comments