sabberworm / 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

Missing space in @media(...) throws exception

voehl opened this issue · comments

commented

Unfortunately, when parsing stylesheets without the space in "@ media(" the parser throws an UnexpectedTokenException.

Example:

<?php
use Sabberworm\CSS\Parser;
require '../vendor/autoload.php';

// This works:
(new Parser('@media (min-width: 768px){.class{color:red}}'))->parse();

// This throws an exception: 'Identifier expected. Got “: 768”'
(new Parser('@media(min-width: 768px){.class{color:red}}'))->parse();

Closing as duplicate of #75