Available from versionĀ ???
Allows for adjusting or replacing the StylesheetSanitizer. For example, you might add, remove, or redefine at-rule sanitizers.
Define function:
public static function onTemplateStylesStylesheetSanitizer( &$sanitizer, $propertySanitizer, $matcherFactory ) { ... }
Attach hook:
$wgHooks['TemplateStylesStylesheetSanitizer'][] = 'MyExtensionHooks::onTemplateStylesStylesheetSanitizer';
Called from:File(s): TemplateStyles / TemplateStylesHooks.php

For more information about attaching hooks, see Manual:Hooks.
For examples of other extensions using this hook, see Category:TemplateStylesStylesheetSanitizer extensions.


Wikimedia\CSS\Sanitizer\StylesheetSanitizer to be used for sanitization. The array returned by $sanitizer->getRuleSanitizers() will use the at-rule names (including the '@') as keys. The style rule sanitizer has key 'styles'.
Wikimedia\CSS\Sanitizer\StylePropertySanitizer being used for sanitization, for use in adding or redefining rule sanitizers.
Wikimedia\CSS\Grammar\MatcherFactory being used, for use in adding or redefining rule sanitizers.