Skip to content

Doesn't parse number sign character #6

Open
@radarfox

Description

@radarfox

From the CSS specification:

The format of a length value is an optional sign character ('+' or '-', with '+' being the default) immediately followed by a number...

Current output:

  • -1px => [{"type":"ident","string":"-1px"}]
  • -1 => [{"type":"ident","string":"-1"}]
  • -0 => [{"type":"ident","string":"-0"}]
  • +0 => throws failed to parse near +0...
  • +1 => throws failed to parse near +1...
  • +1px => throws failed to parse near +1px...

Expected output:

  • -1px => { type: 'number', string: '-1px', unit: 'px', value: -1 }
  • -1 => { type: 'number', string: '-1', unit: '', value: -1 }
  • -0 => { type: 'number', string: '-0', unit: '', value: -0 }
  • +0 => { type: 'number', string: '+0', unit: '', value: 0 }
  • +1 => { type: 'number', string: '+1', unit: '', value: 1 }
  • +1px => { type: 'number', string: '+1px', unit: 'px', value: 1 }

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