mattbasta / crass

A CSS minifier and utility library for JavaScript

Home Page:http://mattbasta.com/crass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse error on filter thing

peterbe opened this issue · comments

▶ cat bar-lite.css
.selector{filter:blur(5px) grayscale(0.7)}

▶ ./node_modules/.bin/crass bar-lite.css

/private/tmp/node_modules/crass/dist/grammar.js:650
                throw new _parseError(str, hash);
                ^
Error: Parse error on line 1:
...or{filter:blur(5px) grayscale(0.7)}
-----------------------^
Expecting 'IDENT', 'S', ';', '}', ')', 'SLASH_ZERO', 'PAGE_TOP_LEFT_CORNER', 'PAGE_TOP_LEFT', 'PAGE_TOP_CENTER', 'PAGE_TOP_RIGHT', 'PAGE_TOP_RIGHT_CORNER', 'PAGE_BOTTOM_LEFT_CORNER', 'PAGE_BOTTOM_LEFT', 'PAGE_BOTTOM_CENTER', 'PAGE_BOTTOM_RIGHT', 'PAGE_BOTTOM_RIGHT_CORNER', 'PAGE_LEFT_TOP', 'PAGE_LEFT_MIDDLE', 'PAGE_LEFT_BOTTOM', 'PAGE_RIGHT_TOP', 'PAGE_RIGHT_MIDDLE', 'PAGE_RIGHT_BOTTOM', '*', 'IE_FILTER', '!', 'SLASH_NINE', got 'FUNCTION_IDENT'

So it chokes on filter:blur(5px) grayscale(0.7).
I don't know if this is valid CSS or not but I didn't write it. I got it from https://semantic-ui.com/ which is what I use for my blog.

Thanks! Looks like this is happening because it's trying to parse filter as Internet Explorer's old filter rule. I'll see what I can do in a bit.