We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
failed to parse near +0...
+1
failed to parse near +1...
+1px
failed to parse near +1px...
Expected output:
{ type: 'number', string: '-1px', unit: 'px', value: -1 }
{ type: 'number', string: '-1', unit: '', value: -1 }
{ type: 'number', string: '-0', unit: '', value: -0 }
{ type: 'number', string: '+0', unit: '', value: 0 }
{ type: 'number', string: '+1', unit: '', value: 1 }
{ type: 'number', string: '+1px', unit: 'px', value: 1 }
The text was updated successfully, but these errors were encountered:
Post CSS is more or less the same as Rework (but actively maintained), you might be better off using that these days
Sorry, something went wrong.
Thanks for the response, but it seem to me, that Rework doesn't parse the values. All I need is to convert "-1px" into {value: -1, unit: "px"}.
"-1px"
{value: -1, unit: "px"}
In Rework i need to do something like * {top: -12px} and all I get is {property: "top", type: "declaration", value: "-12px"} which i useless to me.
* {top: -12px}
{property: "top", type: "declaration", value: "-12px"}
Or am I missing something?
No branches or pull requests
From the CSS specification:
Current output:
-1px
=>[{"type":"ident","string":"-1px"}]
-1
=>[{"type":"ident","string":"-1"}]
-0
=>[{"type":"ident","string":"-0"}]
+0
=> throwsfailed to parse near +0...
+1
=> throwsfailed to parse near +1...
+1px
=> throwsfailed 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 }
The text was updated successfully, but these errors were encountered: