Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exception thrown on float duration values #76

Closed
bartveneman opened this issue Mar 19, 2019 · 9 comments
Closed

Exception thrown on float duration values #76

bartveneman opened this issue Mar 19, 2019 · 9 comments

Comments

@bartveneman
Copy link

  • Webpack Version: N/A
  • Operating System (or Browser):linux/amd64
  • Node Version: node v10.15.2
  • postcss-values-parser Version: 3.0.2

How Do We Reproduce?

Link to repl.it: https://repl.it/@bartveneman/postcss-values-parser-302-duration-errors

Expected Behavior

parse('.7s') does not throw on time values that are floats

Actual Behavior

parse('.7s') throws <css input>:1:1: Unknown word

@shellscape
Copy link
Owner

Ah, s as a unit. Can you link to the spec for other valid time-units?

@bartveneman
Copy link
Author

Basically s and ms are allowed values. Level 2 defines that values may not be negative, but that note has disappeared from Level 3 onwards.

MDN provides examples with negative values, so might be useful to take that into consideration as well

@radeno
Copy link
Contributor

radeno commented Jun 24, 2019

Any time sheet when this issue will be fixed?
Should be compatible with https://drafts.csswg.org/css-values-4/#numeric-types right?
So just unitRegexp should be updated or is it necessary to make bigger changes?
https://github.com/shellscape/postcss-values-parser/blob/master/lib/nodes/Numeric.js#L17

@shellscape
Copy link
Owner

@radeno that's probably what needs to be updated, and tests will need to be added as well. I would happily review a pull request for this.

@bartveneman
Copy link
Author

I'd be happy to give this a try. Would it bu useful to append something like this to the test array and expand the regex until it doesn't fail?

    '-5deg',
    '5deg',
    '5.5deg',
    '-5.5deg',
    '.5deg',
    '-.5deg',

@radeno
Copy link
Contributor

radeno commented Jun 25, 2019

@bartveneman i tried to add angle values, but when 90deg was set then test fails. I don't have time to dig deeper. But time values support waits in PR.

@bartveneman
Copy link
Author

Ah, sorry, I missed that reference above 😬

@glen-84
Copy link

glen-84 commented Aug 6, 2019

@shellscape Should this be closed? (by #87)

@shellscape
Copy link
Owner

Indeed it should. Thanks for the heads up @glen-84 !

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants