DEV Community

Sunder Iyer
Sunder Iyer

Posted on

1

TIL CSS v* units

2021-04-15

When games and browsers combine! I'm displaying text for a web visual novel using TuesdayJS and I'm running into font visibility issues on some devices.

Fortunately CSS has some useful units that work relative to the viewport! There's

  • vw - 0.01x of the viewport width
  • vh - 0.01x of the viewport height
  • vmin - 0.01x of the smaller of the two dimensions
  • vmax - 0.01x of the greater of the two dimensions

So far using a font size based on the vmin gives me a result that seems to work nicely on different screens.

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay