Skip to content
New issue

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

Inconsistent formatting of degenerate numbers with units #2070

Closed
kaj opened this issue May 1, 2023 · 2 comments · Fixed by #2138
Closed

Inconsistent formatting of degenerate numbers with units #2070

kaj opened this issue May 1, 2023 · 2 comments · Fixed by #2138
Assignees
Labels
bug cosmetic Doesn't affects CSS semantics

Comments

@kaj
Copy link

kaj commented May 1, 2023

In spec/values/numbers/degenerate.hrx there is tests for degenerate numbers both in css output and in error messages. The css output formats the numbes like e.g.

a {
  b: calc(-infinity * 1px);
}

... while the error messages looks like:

Error: calc(-Infinitypx*em) isn't a valid CSS value.

Could the expected error messages be updated to have the same formatting as the css output (in this case calc(-infinity * 1px*em) with lower-case i and multiplied by one for the unit) ?

It would make other implementations (like rsass) simpler, and my guess is that it should simplify dart sass as well.

@jathak jathak self-assigned this May 1, 2023
@jathak jathak transferred this issue from sass/sass-spec Aug 21, 2023
@jathak jathak added bug cosmetic Doesn't affects CSS semantics and removed enhancement labels Aug 21, 2023
@nex3
Copy link
Contributor

nex3 commented Aug 21, 2023

Other implementations don't have to match the same error output as Dart Sass; since errors are purely cosmetic, you can feel free to have your own formatting as long as you emit errors under the same circumstances.

@kaj
Copy link
Author

kaj commented Aug 22, 2023

Other implementations don't have to match the same error output as Dart Sass

That is true, thanks. But by trying to make the errors exactly the same in rsass as in dart sass, I make it easier for myself to keep track of which things are handled correctly and what remains to be done.

Also, I think avoiding "Infinitypx" and making errors consistent with the css formatting would be an improvement for dart sass as well. So I agree with @jathak that this is a bug, but only a cosmetic one.

@nex3 nex3 assigned nex3 and unassigned jathak Dec 4, 2023
nex3 added a commit that referenced this issue Dec 5, 2023
nex3 added a commit to sass/sass-spec that referenced this issue Dec 5, 2023
@nex3 nex3 closed this as completed in #2138 Dec 8, 2023
nex3 added a commit to sass/sass-spec that referenced this issue Dec 8, 2023
nex3 added a commit that referenced this issue Dec 8, 2023
lmeysel pushed a commit to lmeysel/dart-sass that referenced this issue Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cosmetic Doesn't affects CSS semantics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants