trys / utopia-core-scss

The calculations behind Utopia.fyi. Written in SCSS.
61 stars 3 forks source link

Consider using `vw` instead of `vi` for a while #6

Open nachtfunke opened 3 weeks ago

nachtfunke commented 3 weeks ago

Hello!

I noticed that the clamp function uses logical viewport units, vi instead of vw https://github.com/trys/utopia-core-scss/blob/main/src/utopia.scss#L13. Support for this unit seems a bit shaky for at least some older browsers.

This is just a suggestion of course, but maybe it would be wise to at least for a while still, use vw for a while. In my case, I have to add postprocessing to my build process because I have get rid of this unit.

xplosionmind commented 3 weeks ago

I agree, thanks @nachtfunke!

Scrolling in Firefox on iOS becomes very messy because as the status bar is hidden/displayed the logical viewport size changes, and with it all the contents of the page.

nachtfunke commented 3 weeks ago

What makes this especially nasty is that it is difficult to find out how supported the vi unit is. Not even caniuse gives any good answers: https://caniuse.com/viewport-units or https://caniuse.com/viewport-unit-variants