Commit 2c31a36
committed
styles: format and lint CSS files using Stylelint
Use stylelint with stylelint-config-wikimedia, specifically the support-modern preset which targets grade A browsers. This is in preparation for #2300 which will introduce some involved CSS.
Rule customisations used:
* @stylistic/*-space-inside: "never", per repo code style of not putting spaces in parens
* selector-attribute-quotes: "never".
* selector-max-id: 1. MediaWiki uses 0 which disallows ids in selectors completely! That would lead to a lot of errors for us.
* declaration-no-important: null. Disabled temporarily. Ideally, we should remove this.
All CSS changes are no-op (mostly done via auto-fixes,) mainly:
* Changed hex codes to use lowercase letters instead of uppercase
* Consistently used tabs
* Consistently put opening brace on same line as the selector
* Combined the two blocks for .morebits-ui-tooltip in morebits.css
* prefers-color-scheme: dark isn't supported in Safari 11 which still happens to be Grade A, so used a per-line stylelint-disable. In practise, Safari 11 isn't much used, and per CSS spec unsupported rules and media queries are just ignored - they don't cause the stylesheet to fail.
* stylelint-config-wikimedia disallows px unit in font-size and line-height for accessibility reasons, which is probably something we should also fix. Temporarily disabled inline as fixes won't be no-op.
* stylelint-config-wikimedia disallows `border: none`. Replaced it with `border: 0` which has the same effect.1 parent 46bfd7a commit 2c31a36
File tree
5 files changed
+2551
-342
lines changed- src
5 files changed
+2551
-342
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments