title | date | submitter | number | tags | discussion | |
---|---|---|---|---|---|---|
I want support for fractional pixel values |
2019-11-26 22:05:09 UTC |
Dzmitry Shymkin |
91 |
|
In native applications UI it is common to use lines that have thickness of 1 physical pixel. With web technologies it is non-trivial to render such lines on screens with a pixel ratio of greater than 1. Safari does allow for fractional values (e.g., border-width: 0.5px
for devicePixelRatio=2 and border-width: 0.3333px
for devicePixelRatio=3).
No other browsers support this though. Instead, we have to rely on hacks like transform: scale(0.5)
.