frem

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i frem

Weekly Downloads

45

Version

1.0.0

License

ISC

Unpacked Size

1.46 kB

Total Files

3

Last publish

Collaborators

  • ehgoodenough