After noticing a css error in the most popular theme (minimal), I decided to download every theme and see how widespread css errors are. Shell script using curl, jq to download them all. Stylelint with all rules turned off to just check for syntax errors.
- 21 themes in the official theme list have syntax errors.
- Most common type of error is theme makers thinking css supports
// foo
shape comments. CSS only supports/* foo */
shaped comments. These all show up asunknown word
in the syntax-check.txt report.- A couple of these were introduced when someone tried to "comment out" a rule.
// color: red;
- A couple of these were introduced when someone tried to "comment out" a rule.
- Handful of extra or missing
}
;
. I tried to file pull requests for the obvious ones.
It might be helpful to set up a "starter theme" repo that already has css linting built into it. You could use github actions or git hooks to enable this.