parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.36k stars 182 forks source link

Viewport units #534

Open Ayc0 opened 1 year ago

Ayc0 commented 1 year ago

Shouldn't viewport units like dvh, svh, and lvh be compiled to vh for older browsers? (same for dvw, svw, and lvwvw)

Here we can see that the newer CSS colors are getting updated for older browsers (chrome 90), but not the viewport height – playground

image
devongovett commented 1 year ago

I don't think compiling dvw to just vw would be correct though. It wouldn't adjust correctly based on things like toolbars appearing. You could polyfill it but you'd need JavaScript.

Ayc0 commented 1 year ago

Even if it's not 100% correct, it could be a good fallback Like for colors out of their color scale (like color(display-p3 0 1 0))