parser-lib
parser-lib copied to clipboard
Fixes #229. Throws syntax error for empty functions and doesnt block …
…anymore.
Maybe I shouldn't throw the SyntaxError though. What do you think?
Hmm, this can be a breaking change as far as I can tell. On the other hand not throwing an error can be bad too.
Not sure how to proceed. If you need this for CSS Lint I guess we should merge it. I'm just not sure about any other projects that depend on parer-lib.
Some functions can be empty according to the spec e.g. all filter: functions like invert() is a valid CSS which does nothing, though (at least in compliant browsers, for example Chrome recently fixed their crbug.com/798683). In my rewrite of CSSLint+parserlib for Stylus I've added ValidationTypes.functions and ValidationTypes.functionsMayBeEmpty which consists of 10 filter functions (blur, brightness, contrast, drop-shadow, grayscale, hue-rotate, invert, opacity, saturate, sepia) and 'content' function.