This is free software licensed under the GNU General Public License. Please see http://www.gnu.org/copyleft/gpl.html for further details, including the full text and terms of the license.
Offers theming support with a low flash of wrongly themed content for wikis behind aggressive caching.
Test installation link (may be broken).
Manual installation:
- Clone the repository to
extensions/ThemeToggle. - Check out the release branch for your MediaWiki version.
wfLoadExtensionin site configuration.- Consider deploying the extension only to registered users for the configuration period. Set
$wgThemeToggleEnableForAnonymousUserstofalse. - If deploying to ALL visitors, purge the cache for HTML pages.
$wgThemeToggleEnableForAnonymousUsers: whether the extension is active for anonymous users.-
- Changing this requires purging cache.
-
- Defaults to
true.
- Defaults to
$wgThemeToggleDefault: theme that will be used by default for anonymous and new users.-
- Changing this requires purging cache.
-
- Defaults to
auto.
- Defaults to
$wgThemeTogglePreferenceGroup: suffix to add to the preference name on this wiki. Set this on wiki-farms if user preferences are shared and you want a wiki to have a separate theme toggle.-
- Defaults to wiki ID.
$wgThemeToggleDisableAutoDetection: cuts away support for theautomatic theme detection (based on prefers-color-scheme). Only set this if you are sure you don't need automatic detection, or do not use alightanddarktheme combination.-
- Defaults to
false.
- Defaults to
$wgThemeToggleSwitcherStyle: switcher style.-
- Defaults to
auto.
- Defaults to
-
- Possible values:
-
-
simple: an icon-based switcher that cycles through themes.
-
-
-
dropdown: a dropdown-based switcher.
-
-
-
auto: simple if one or two themes, dropdown if more.
-
-
-
none: no switcher.
-
-
- No cache purge required.
$wgThemeToggleLoadScriptOverride: controls the ResourceLoader endpoint used for loading themes.-
- Defaults to
$wgLoadScript.
- Defaults to
-
- Set to another wiki's
load.phpto load theme modules from it.
- Set to another wiki's
-
MediaWiki:Theme-definitionsand configuration settings still need to be updated manually.