Skip to content

WIP: Add html validation using css (development only)

username-removed-408677 requested to merge css-html-validator into master

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
Screen_Shot_2017-04-08_at_1.45.16_PM Screen_Shot_2017-04-08_at_1.44.53_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

None

Merge request reports