diff --git a/extension.json b/extension.json index 38d485c..b985bc7 100644 --- a/extension.json +++ b/extension.json @@ -21,6 +21,10 @@ "TemplateStylesExtenderEnablePrefersColorScheme": { "description": "Enable the prefers-color-scheme media query. WARNING this can break things if TemplateStyles was updated upstream", "value": true + }, + "TemplateStylesExtenderEnableCssVars": { + "description": "Enable the matcher for css variables", + "value": true } }, "MessagesDirs": { diff --git a/includes/Hooks/StylesheetSanitizerHook.php b/includes/Hooks/StylesheetSanitizerHook.php index d272208..f90b19a 100644 --- a/includes/Hooks/StylesheetSanitizerHook.php +++ b/includes/Hooks/StylesheetSanitizerHook.php @@ -56,10 +56,15 @@ class StylesheetSanitizerHook { $extender = new StylePropertySanitizerExtender( $matcherFactory ); - $extended->addVarSelector( $propertySanitizer, $matcherFactory ); + if ( TemplateStylesExtender::getConfigValue( + 'TemplateStylesExtenderEnableCssVars', + true ) === true ) { + $extended->addVarSelector( $propertySanitizer, $matcherFactory ); + } $extended->addImageRendering( $extender ); $extended->addRuby( $extender ); + $extended->addPointerEvents( $extender ); $extended->addScrollMarginProperties( $extender, $matcherFactory ); $propertySanitizer->setKnownProperties( $extender->getKnownProperties() );