Live Demo: Try this and other plugins live β no installation, no risk: demo.markus-michalski.net
src/
βββ MmdAccessibility.php Plugin class, cleans up system_config on uninstall
βββ Subscriber/
β βββ StorefrontRenderSubscriber.php Passes configuration to the templates
βββ Resources/
βββ config/
β βββ config.xml Plugin settings (admin)
β βββ services.xml Service wiring
βββ app/storefront/src/scss/base.scss Widget styles and effect classes
βββ public/js/accessibility-widget.js Vanilla JS widget, no build step required
βββ snippet/de_DE/, en_GB/ Translations
βββ views/storefront/
βββ base.html.twig Includes SVG filters, widget and widget script
βββ component/accessibility/
βββ widget.html.twig Trigger button and settings panel
βββ svg-filters.html.twig SVG filter definitions for color vision deficiencies
StorefrontRenderSubscriber listens for StorefrontRenderEvent and exposes the plugin configuration under the Twig variable mmdAccessibility:
| Config Key | Twig Path | Default |
|---|---|---|
widgetEnabled |
mmdAccessibility.enabled |
true |
widgetPosition |
mmdAccessibility.position |
bottom-right |
optionFontSize |
mmdAccessibility.options.fontSize |
true |
optionContrast |
mmdAccessibility.options.contrast |
true |
optionColorFilter |
mmdAccessibility.options.colorFilter |
true |
optionBlueLight |
mmdAccessibility.options.blueLight |
true |
optionAnimations |
mmdAccessibility.options.animations |
true |
Two safeguards in the subscriber:
bottom-right, bottom-left); any other stored value falls back to bottom-right. This prevents a manipulated config value from injecting CSS into the page."false" would otherwise be interpreted by PHP as true; the subscriber falls back to the default instead.