Skip to content

valueParser.unit(quantity) and scientific numbers #37

Closed
@jeddy3

Description

@jeddy3

Firstly, thanks for writing this parser! We use it extensively in stylelint and its been rock solid so far.

We use valueParser.unit(quantity) in our unit-no-unknown rule.

An issue, stylelint/stylelint#3537, was raised about support for scientific numbers (e.g. 4e2px) as covered in the specs.

Reproduce with:

var postcssValueParser = require("postcss-value-parser");
postcssValueParser.unit("1e5px")

Expected:

{
  number: "1e5",
  unit: "px"
}

Got:

Expected:

{
  number: "1",
  unit: "e5px"
}

Is this something you'll be willing to support in this value parser?

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