Overview
The Citizen skin includes a powerful preferences system that allows users to customize their experience without requiring an account. Preferences are stored locally in the browser and sync instantly across the interface.All preferences are client-side only - they’re stored in the browser’s localStorage and don’t require server-side configuration.
Accessing Preferences
Click the preferences toggle button in the header to open the preferences panel. The panel displays as a dropdown menu with organized sections.Available Preferences
Appearance Section
Customize the visual appearance of your wiki:Color Theme
Type: Radio buttons (3 columns)Options:
- Auto - Follow system theme (light/dark based on OS settings)
- Light - Always use light theme
- Dark - Always use dark theme
Text Size
Type: Select dropdownOptions:
- Small
- Standard (default)
- Large
- Extra large
Content Width
Type: Select dropdownOptions:
- Standard (default)
- Wide
- Full
Pure Black Mode
Type: Toggle switchAvailable: Only visible in dark theme Replaces dark gray backgrounds with pure black (#000000) for OLED screens and reduced eye strain.
Image Dimming
Type: Toggle switchAvailable: Only visible in dark theme Reduces the brightness of images in dark mode to prevent harsh contrast and improve reading comfort.
Behavior Section
Control how the interface responds to your actions:Automatically Hide Navigation
Type: Toggle switchAvailable: Only on tablet viewports and larger Automatically hides the navigation bar when scrolling down and shows it when scrolling up, providing more screen space for content.
Performance Mode
Type: Toggle switchAvailable: Always Reduces animations and visual effects for:
- Improved performance on older devices
- Users who prefer reduced motion
- Better battery life on mobile devices
Performance mode respects the
prefers-reduced-motion CSS media query and system accessibility settings.How Preferences Work
Storage
Preferences are stored using MediaWiki’s client preference API (or a polyfill):- Saved in browser localStorage
- Persist across sessions
- Device-specific (don’t sync between devices)
- Don’t require a user account
Live Updates
Preferences apply immediately:- User toggles a preference
- Value is saved to localStorage
- CSS classes are updated on
<html>element - Interface reflects the change instantly
mw.hook('citizen.preferences.changed')fires for extensions
CSS Classes
Preferences apply CSS classes to enable visual changes:Configuration
Default Preferences
Defaults are defined inresources/skins.citizen.preferences/defaultConfig.js:
Adding Custom Preferences
Administrators can add custom preferences viaMediaWiki:Citizen-preferences.json or by using the registration hook:
Visibility Conditions
Preferences can show/hide based on conditions:always- Always visibledark-theme- Only visible when dark theme is activetablet-viewport- Only visible on tablet-sized screens and larger
Internationalization
All preference labels and descriptions are translatable:i18n/en.json and can be translated via MediaWiki’s translation system.
Technical Implementation
The preferences system is built with:- Vue 3 with Composition API
- Codex components (CdxToggleSwitch, CdxField, CdxSelect)
- Reactive state management
- localStorage persistence
- CSS custom properties for theming
Architecture
Best Practices
Test your custom preferences in both light and dark themes to ensure consistent appearance.