feat: Allow to disable the var matcher

This commit is contained in:
Hannes 2021-05-21 21:51:31 +02:00
parent ec064f083e
commit e286af5b2d
No known key found for this signature in database
GPG key ID: 371029119C5F0D51
2 changed files with 10 additions and 1 deletions

View file

@ -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": {

View file

@ -56,10 +56,15 @@ class StylesheetSanitizerHook {
$extender = new StylePropertySanitizerExtender( $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() );