nb000's CSS checker - documentation
About What is nb000's CSS checker?
As it's name states it is a program written in javascript that checks CSS code for validity.
It recognizes all CSS reserved words (property names, values, others).

How does it work?
First it removes all comments and unnecessary whitespaces.
Then it checks if all the remaining characters are allowed.
(For example there can be no dollar ($), ampersand (&) and less-than sign (<) in the text.)
Then the text will be splitted into so-called tokens (selectors, numbers, colors, ...).
The final step is the parsing of the array of tokens. This accepts or rejects the CSS code.
After parsing the array of tokens can be displayed (this is the colored CSS code).
This can be done even if the parsing fails, since it only uses the array of tokens.
During all steps if there is any error, it will be printed to the output box.

Why is this good for anyone?
Because You can see any errors in your CSS code highlighted with red very quickly.

How can I contact the author?
You can write me an email: nb0000 AT gmail DOT com
Please write @ in place of AT and . instead of DOT.

Example output
Used color codes
  • @charset - at-rules (charset, import, media, page, ...)
  • #options - any css selector (type, class, id, attribute and pseudo selectors)
  • background - any css property
  • green - any color (it can be in 3 or 6 digit hexa notation or have a name or use the rgb macro)
  • length or number - any number or length (em, ex, px, %, in, cm, mm, pt, pc)
  • underline - any value for a css property that is not a color, length or number
  • !important - the yet only css priority
  • default - the token is recognized but has no color code assigned (should not happen :)
  • gold - the token (text) is not recognized (only the 17 basic colors can be used with their names)
Options
  • Show colored output css
    You can turn off displaying the colored CSS to see only the error and warning messages.

  • Show unrecognized tokens
    You may turn this on to see if all CSS properties and values were recognized.

  • Show output minimized
    If checked, then new lines are only inserted after braces and semicolons, no formatting spaces are used.
    If not checked, then some spacing is done.

  • Show warning messages
    You can turn off warning messages, to only see errors.