Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.04 KB

README.md

File metadata and controls

31 lines (25 loc) · 1.04 KB

Viewport Polyfill

Polyfill for all of your viewport units in css! VH, VW, VMIN, VMAX.

How to use it

  • Clone or download this repo
  • Read instructions inside viewportPolyfill.js (I promise, it's easy!)
  • Run node viewportPolyfill.js

How it works

When you run node viewPolyfill.js it reads your target css file. After it has done that it exports a function that sets all the appropriate styles using javascript.

What you'll get

You'll get a function that you can run in your JavaScript. Reason for this is so that you can bind it in any events and so that it is easy to use!

Why I built it

I love building websites as much as you do and quite usually old internet browsers have to be supported. Yes, this is annoying. But, with all these polyfills on the internet it makes your life as well as mine a lot easier. This is one of those polyfills. It works a little different (you don't import it in your HTML) but the result is the same :)