Debian Codegraph @

skins/Vector/doc/adr/0002-use-css-custom-properties.md

raw symbols SCIP
1 # 2. Use CSS custom properties in Vector
2
3 Date: 2023-10-23
4
5 ## Status
6
7 Accepted.
8
9 ## Context
10
11 In the context of the [Accessibility for Reading project](https://www.mediawiki.org/wiki/Reading/Web/Accessibility_for_reading) we needed a way to enable font-size customization in Vector in a scalable way. CSS custom properties were the mechanism chosen to enable this functionality. Full discussion available on [T346072](https://phabricator.wikimedia.org/T346072).
12
13 ## Decision
14 CSS Custom properties will be implemented in Vector on a very tightly scoped basis. The implementation assumes that we will eventually want to up-stream CSS custom properties to MediaWiki core/Codex.
15
16 In order to facility an eventual migration, the following implementation measures will be taken:
17
18 - CSS custom properties will be used *only* when needed for client-size customization.
19 - CSS custom properties will be grouped in the following file
20 `resources/skins.vector.styles/CSSCustomProperties.less`.
21 - CSS custom properties will maintain consistency with the naming convention of Codex design tokens.
22 - When possible, we'll assign CSS custom properties to existing Codex token values.
23
24 ## Consequences
25
26 CSS Custom properties will be marked as `@private` and `@experimental` in the spirit of the [Stable interface policy/Frontend](https://www.mediawiki.org/wiki/Stable_interface_policy/Frontend) in order to discourage usage outside of Vector. This could be changes to `@internal` if usage outside of Vector is deemed necessary.