1.0.3 • Published 10 years ago

baseunit v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

baseUnit

DOM module to replicate the vmin/vmax CSS unit. Take a look at an example.

Example

I commonly use this to set the base font-size on HTML in conjunction with rem units in my CSS. Here's an example of the JS:

var baseUnit = require('baseunit')
var head = document.getElementsByTagName('html')[0]

function setUnit () {
  var size = baseUnit()
  head.style.fontSize = size + '%'
}

setUnit()
window.addEventListener('resize', setUnit, false)
1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago