parser-lib icon indicating copy to clipboard operation
parser-lib copied to clipboard

Fixes #229. Throws syntax error for empty functions and doesnt block …

Open frvge opened this issue 8 years ago • 2 comments

…anymore.

Maybe I shouldn't throw the SyntaxError though. What do you think?

frvge avatar May 28 '17 00:05 frvge

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.

XhmikosR avatar May 30 '17 05:05 XhmikosR

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.

tophf avatar Jan 15 '18 20:01 tophf