Allow creation of CSS variables for colors in TemplateStyles (Community Wishlist/W502)
Currently, when a color needs to be adapted for dark mode, the CSS selectors targeting it must be copied three times: once for light mode, once for dark mode, and once for automatic mode. Additionally, if a child template wants to override this color, the selectors must be copied three more times, plus targeting for a specific class each time.
Being able to define CSS variables would mean only needing to modify the color value based on the selected mode and the child-specific selectors, without having to repeat the other selectors every time. This would simplify code readability and maintenance, and make child templates less vulnerable to changes in parent templates.
This wish specifically concerns defining CSS variables whose values are valid colors. In particular, it does not involve allowing the url() function, whose security risks are mentioned in the related Phabricator task.
Unassigned
template editors
- Created: 09:43, 30 January 2026
- Last updated: 15:42, 1 February 2026
- Author: Escargot bleu (talk)
This wish currently has 7 supporters. Voting for this wish is open until it is completed.