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.

CSS property values that are strings shouldn't have 'px' appended

See original GitHub issue

It’s weird that style={{margin: '42'}} gets turned into margin: 42px;. I think we should only add px if the value is an actual number.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sophiebitscommented, Sep 19, 2017

@aweary Too late for breaking changes for 16, let’s look at doing it in 17. Can probably land soon after the release behind a flag.

0reactions
gaearoncommented, Oct 4, 2017

Hmm. I neither see a warning, nor do I see it apply the style. I think this was fixed in 16.

https://jsfiddle.net/r44uryb1/

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS values and units - Learn web development | MDN
Note: Yes, CSS value types tend to be denoted using angle brackets to differentiate them from CSS properties (e.g., the color property, versus ......
Read more >
CSS Values and Units Module Level 3 - W3C
This CSS module describes the common values and units that CSS properties accept and the syntax used for describing them in CSS property...
Read more >
4. Values and Units - CSS: The Definitive Guide, 4th ... - O'Reilly
Everything in a stylesheet is text, but there are certain value types that directly represent strings of text as opposed to, say, numbers...
Read more >
Append unit type to the result of a calculation in Sass
#{1}px ) will only create a string that looks like a number. ... to use your value in another arithmetic operation, you should...
Read more >
Truncate String with Ellipsis - CSS-Tricks
.truncate { width: 250px; white-space: nowrap; overflow: hidden; ... ideally the input text field should not have support for this property ...
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