This task is to rename the mediawiki.toc.styles ResourceLoader module in preparation for repurposing. The intended usage is:
- High-traffic, every pageview styles common for skins, at least Vector and Minerva Neue. The module is enqueued by Skin:getDefaultModules() by default (and thus in Vector and Minerva).
- Eventual home for at least the MediaWiki checkbox hack styles that may be used in several contexts including: Vector's collapsible table of contents (currently checkboxtoggle), Vector's more menu, Vector's sidebar, MinervaNeue sidebar (currently ToggleList), MinervaNeue user menu (currently ToggleList), MinervaNeue page overflow menu (currently ToggleList) implementation in MinervaNeue (currently ToggleList). (See T246419.)
- We think it will at least these styles will be universal for all checkbox hack consumers:
.mw-checkbox-hack-checkbox { position: absolute; // Always lower the checkbox behind the foreground content. z-index: -1; // The checkbox `display` cannot be `none` since its focus state is used for other selectors. opacity: 0; } // [todo] replace bindToggleOnClick() with `:focus-visible` when available. See https://css-tricks.com/almanac/selectors/f/focus-visible/.
The module has very little usage currently and is small (69 lines of Less and CSS).
Acceptance criteria
- A new name is chosen as part of this task (ResourceLoaderSkinModule)
- mediawiki.toc.styles is renamed without breaking existing clientele. (the module is deprecated and all skins are using an opt in to new features policy for ResourceLoaderSkinModule)
- The unique table of contents styling inside Minerva is not disrupted by the change (Minerva doesn't use opt in policy so will not be disrupted)
- Add integration tests for ResourceLoaderSkin class (tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php)
Open questions
- Are there other styles we want to plan to put there now?
- Is this a catchall common styles module for all skins?