1.0.0 • Published 5 years ago

frem v1.0.0

Weekly downloads
6
License
ISC
Repository
-
Last release
5 years ago

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})