File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -87,10 +87,9 @@ const allFunctions = [
87
87
const vendorPrefixes = [ '-webkit-' , '-moz-' , '-ms-' , '-o-' ] ;
88
88
const reFunctions = new RegExp ( `^(${ vendorPrefixes . join ( '|' ) } )?(${ allFunctions . join ( '|' ) } )` , 'i' ) ;
89
89
const rePunctuation = new RegExp ( `^(\\${ Punctuation . chars . join ( '|\\' ) } )` ) ;
90
-
91
- const colorFunctionsRegex = / ^ ( h s l a ? | h w b | l a b | l c h | r g b a ? ) $ / i;
92
- const varFunctionRegex = / ^ v a r $ / i;
93
- const varPrefixRegex = / ^ - - [ ^ \s ] + $ / ;
90
+ const reColorFunctions = / ^ ( h s l a ? | h w b | l a b | l c h | r g b a ? ) $ / i;
91
+ const reVar = / ^ v a r $ / i;
92
+ const reVarPrefix = / ^ - - [ ^ \s ] + $ / ;
94
93
95
94
class Func extends Container {
96
95
constructor ( options = { } ) {
@@ -192,9 +191,8 @@ class Func extends Container {
192
191
193
192
const { lastNode } = parser ;
194
193
const { nodes } = node ;
195
- lastNode . isColor = colorFunctionsRegex . test ( lastNode . name ) ;
196
- lastNode . isVar =
197
- varFunctionRegex . test ( lastNode . name ) && nodes . length && varPrefixRegex . test ( nodes [ 0 ] . value ) ;
194
+ lastNode . isColor = reColorFunctions . test ( lastNode . name ) ;
195
+ lastNode . isVar = reVar . test ( lastNode . name ) && nodes . length && reVarPrefix . test ( nodes [ 0 ] . value ) ;
198
196
}
199
197
}
200
198
You can’t perform that action at this time.
0 commit comments