MyIntervals / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

var function inside color functions cannot be parsed

digilist opened this issue · comments

Thank you for this library. I just started playing around with it and it works really good so far.

But I just noticed that parsing a rule like the following fails:

a {
    background: rgba(var(--some-rgb) , 0.1);
}

The reason is that the var is inside the rgba function. If strict mode is enabled, this error is given: Token “,” (1) not found. Got “var(-”.

But this is valid CSS, see here for example: https://stackoverflow.com/a/41265350/1044527

UPDATE: fails also for rgb(var(--some-rgb))

I believe this is a duplicate of #186.