Skip to content

The parser chokes on 1.5dppx #104

@nex3

Description

@nex3
  • Operating System (or Browser): RunKit
  • Node Version: 10.18.0
  • postcss-values-parser Version: 3.1.1

How Do We Reproduce?

https://runkit.com/nex3/5e446258c092240013ead2f1

const pvp = require('postcss-values-parser')
pvp.parse("1.5dppx")

Expected Behavior

I expect this to parse as a Numeric.

I chose to highlight dppx here because it's a specified unit, but this will reproduce with any unit string postcss-values-parser doesn't explicitly recognize. I would more broadly expect anything matching <dimension-token> to parse as a Numeric, even if its unit isn't specified yet. This is more future-proof as the specification evolves, and more friendly to postprocessors that may define their own custom units.

Actual Behavior

It throws a CssSyntaxError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions