frem
v1.0.0
Published
Fits your css rem into a pixel responsive aspect-ratio.
Downloads
43
Readme
Frem
Fits your css rem into a pixel responsive aspect-ratio.
FAQ
Q: What does it mean for my rem to fit an aspect ratio?
A: If you set your aspect-ratio to 16:9 and then size a div to 16rem
by 9rem
, it'll be completely contained in the screen while also filling the screen as much as it can.
Q: Why not use viewport units like vw or vh?
A: Because viewport units don't handle fractions well, which renders gross pixel gaps everywhere. I used this approach for years before abandoning it.
Q: Why would you want this??
A: For web game development, mostly.
Getting Started
const frem = require("frem")
frem({"width": 16, "height" 9})