Skip to content

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

Closed
@voehl

Description

@voehl

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions