question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unitless values should not compare as equal to unitful values

See original GitHub issue

(Edit after the fact by @nex3)

Tasks:

  • Deprecate existing behavior in stable.
  • Remove behavior from master.

I know the existing behavior was intentional, but it breaks the basic rules of math: if 1px == 1 and 1 == 1em, then 1px == 1em. That sounds like a bug to me. In CSS the actual unit or lack of unit is very important. I can’t think of any real use-case where I would be equally happy with or without a unit.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:26 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
nex3commented, Jan 5, 2018

I can take it that unit/unitless operations remain a stable core behavior?

That’s correct. There are no plans to change anything but boolean operators (and so far, only ==).

0reactions
lunelsoncommented, Jan 5, 2018

Thanks @nex3 ; so I can take it that unit/unitless operations remain a stable core behavior? i.e. 1px + 1 will always be 2px? It’s just a question related to the sass-calc PR reference above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conversion/promotion · Unitful.jl
Convert a Unitful.Quantity to different units. The conversion will fail if the target units a have a different dimension than the dimension of...
Read more >
Utility Functions and Classes
Parameters: value – A value that may or may not be unitful. units – Units to be assumed for value if it does...
Read more >
Make Unitful simplify expressions like 1μm/1m to a unitless ...
I freguently perform computations like 1μm/1m and would like Unitful to return a unitless number by default rather than having to do NoUnits(1μm/1m)....
Read more >
Unitless line-heights – Eric's Archived Thoughts
If I assign a relative value of 1em to the line-height I would expect it to pass on relative as 1em and not...
Read more >
Does the term ##ln(k)## have units in reaction based ...
The more diluted solution the close the value of activity coefficient ... Not only are the outputs of logarithms and exponentials unitless, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found