What does this MR do?
Use CSS to validate HTML by highlighting bad HTML and painting their background red.
The idea is for this to be a visual cue for developers to catch bad html during development because not everyone is aware of what HTML attributes they should be adding (Such as adding attribute type
in <input>
- which I am guilty of). We currently use bootlint
to do some of these HTML linting but since they are logged in the console, developers tend to gloss over them as it is not always overtly obvious where the offending HTML element is at.
Inspired by
https://bitsofco.de/linting-html-using-css/
https://github.com/imbrianj/debugCSS
http://archive.oreilly.com/pub/a/network/2000/07/21/magazine/css_tool.html
https://news.ycombinator.com/item?id=13848196
Are there points in the code the reviewer needs to double check?
Feel free to suggest more rules in validator.scss
Why was this MR needed?
Decrease the use of bad HTML using visual cues when developing GitLab
Screenshots (if relevant)
Without CSS validate | With CSS validate |
---|---|
![]() |
![]() |
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
None