diff --git a/lib/style-ast.js b/lib/style-ast.js index fb2db7a..cb63d5d 100644 --- a/lib/style-ast.js +++ b/lib/style-ast.js @@ -171,9 +171,9 @@ class StyleAST { } // Make all global colors and global typographies with only one digit be available. - let awbColorWithSingleDigit = '(color|custom_color_\d(\D|$))'; - let awbTypoWithSingleDigit = '(typography|custom_typography_\d(\D|$))'; - let colorOrTypoVars = new RegExp( '--awb-(' + awbColorWithSingleDigit + '|' + awbTypoWithSingleDigit + ')' ); + const colorOrTypoVars = new RegExp( + /--awb-((color|custom_color_\d(\D|$))|(typography|custom_typography_\d(\D|$)))/ + ); if ( colorOrTypoVars.test( declaration.property ) ) { return; }