diff --git a/README.md b/README.md index ac0fefc..760397b 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,27 @@ Enables or disables `@media (prefers-color-scheme)` queries. `$wgTemplateStylesExtenderEnableCssVars` Default: `true` Enables or disables css variable support. + +## Notes on CSS vars +Currently using `:root` selectors won't work due to template styles prepending `.mw-parser-output`. + +One possible fix is to wrap the entire content into a `div` element and adding the declarations to this, e.g. +```css +div#content-wrap { + --padding: 10px +} + +.content { + padding: var( --padding ) +} +``` + +Wikitext +```html +
+
+ The WikiText... +
+
+``` + diff --git a/composer.json b/composer.json index f55026b..672d1ce 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mediawiki/template-styles-extender", - "version": "1.0.0", + "version": "1.0.1", "type": "mediawiki-extension", "description": "Extends TemplateStyles with new CSS properties", "homepage": "http://www.mediawiki.org/wiki/Extension:TemplateStylesExtender", diff --git a/extension.json b/extension.json index ffedb89..658aaee 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "TemplateStylesExtender", - "version": "1.0.0", + "version": "1.0.1", "author": [ "Octfx" ],