{"id":15704100,"url":"https://github.com/octfx/mediawiki-extensions-templatestylesextender","last_synced_at":"2025-04-27T06:52:06.246Z","repository":{"id":53671959,"uuid":"349541531","full_name":"octfx/mediawiki-extensions-TemplateStylesExtender","owner":"octfx","description":"Extends TemplateStyles with new selectors and matchers.","archived":false,"fork":false,"pushed_at":"2024-11-17T17:55:15.000Z","size":206,"stargazers_count":8,"open_issues_count":6,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T06:52:00.411Z","etag":null,"topics":["mediawiki-extension"],"latest_commit_sha":null,"homepage":"https://mediawiki.org/wiki/Extension:TemplateStylesExtender","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-19T19:59:50.000Z","updated_at":"2025-01-17T07:49:33.000Z","dependencies_parsed_at":"2022-09-05T04:31:10.819Z","dependency_job_id":"d4b93d81-1d4c-4fed-beef-dd8b4bbb9202","html_url":"https://github.com/octfx/mediawiki-extensions-TemplateStylesExtender","commit_stats":{"total_commits":69,"total_committers":4,"mean_commits":17.25,"dds":"0.14492753623188404","last_synced_commit":"5b97d8f4481b03e148782cad0b52ae55457a24ba"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extensions-TemplateStylesExtender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extensions-TemplateStylesExtender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extensions-TemplateStylesExtender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octfx%2Fmediawiki-extensions-TemplateStylesExtender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octfx","download_url":"https://codeload.github.com/octfx/mediawiki-extensions-TemplateStylesExtender/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251099735,"owners_count":21536153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mediawiki-extension"],"created_at":"2024-10-03T20:10:20.673Z","updated_at":"2025-04-27T06:52:06.226Z","avatar_url":"https://github.com/octfx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TemplateStylesExtender\nExtends Extension:TemplateStyles by the following new matchers:\n\n* CSS Variables:\n  * Example: `color: var( --example-var )`\n* `image-rendering`\n* `ruby-position`\n* `ruby-align`\n* `scroll-margin-*`, `scroll-padding-*`\n* `pointer-events`\n* `aspect-ratio`\n\n## Installation\nDownload the zip file from the [latest release](https://github.com/octfx/mediawiki-extensions-TemplateStylesExtender/releases/latest) page.\n\nExtract the folder to `extensions/TemplateStylesExtender`.  \nAdd the following to `LocalSettings.php`:\n```php\nwfLoadExtension( 'TemplateStyles' );\nwfLoadExtension( 'TemplateStylesExtender' );\n```\n\n## Configuration\n`$wgTemplateStylesExtenderEnablePrefersColorScheme`  \nDefault: `true`  \nEnables or disables `@media (prefers-color-scheme)` queries.\n\n`$wgTemplateStylesExtenderEnableCssVars`  \nDefault: `true`  \nEnables or disables css variable support.\n\n`$wgTemplateStylesExtenderEnableUnscopingSupport`  \nDefault: `false`  \nAllows users with `editinterface` permissions to unscope css by setting a `wrapclass` attribute.\n\n**Note**: This is potentially expensive, as each templatestyles tag with `wrapclass` set, will attempt to look up the user of the current page revision, and check if this user has the permission to activate css un-scoping. \n\nExample:\n`\u003ctemplatestyles src=\"Foo/style.css\" wrapclass=\"mediawiki\" /\u003e` results in the css being scoped to `.mediawiki` instead of `.mw-parser-output`.\n\n**Note**: Including such a call in a page essentially limits editing to users with the `editinterface` right. You can alternatively include a call to a template that includes the styles. \n\n`$wgTemplateStylesExtenderUnscopingPermission`  \nDefault: `editinterface`  \nSpecify a permission group that is allowed to unscope css.\n\n## Notes on CSS vars\nCurrently using `:root` selectors won't work due to template styles prepending `.mw-parser-output`.\n\nOne possible fix is to wrap the entire content into a `div` element and adding the declarations to this, e.g.\n```css\ndiv#content-wrap {\n\t--padding: 10px\n}\n\n.content {\n\tpadding: var( --padding )\n}\n```\n\nWikitext\n```html\n\u003cdiv id=\"content-wrap\"\u003e\n\t\u003cdiv class=\".content\"\u003e\n\t\tThe WikiText...\n\t\u003c/div\u003e\n\u003c/div\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctfx%2Fmediawiki-extensions-templatestylesextender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctfx%2Fmediawiki-extensions-templatestylesextender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctfx%2Fmediawiki-extensions-templatestylesextender/lists"}