Skip to content

sugarshin/fluidfont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fluidfont

Build Status Coverage Status GitHub version License

FluidFont

small library for responsive font

npm i fluidfont

Usage

FluidFont = require 'fluidfont'

new FluidFont opts

or

<script src="fluidfont.js"></script>
<script>
  new FluidFont(opts);
</script>

View on RequireBin

view on requirebin

Config

default options

var options = {
  target: document.body, // DOM Element
  baseWidth: 640, // Integer
  baseSize: '1em', // String, CSS font-size value
  delay: 300, // Integer
  delayType: 'debounce', // String, 'debounce' or 'throttle'
  afterResize: function() {}, // Function
  beforeResize: function() {} // Function
};

api

ff.resize(width)

Resize font

ff.off()

Unbind from resize event of window

Alias: ff.unbind(), ff.rmEvent()

ff.on()

Re add resize event of window

Alias: ff.events(), ff.addEvent()

Contributing

deps

  • bean
  • debounce
  • throttleit

dev deps

  • browserify
  • coffee-script
  • coffeeify
  • coffeelint
  • derequire
  • espower-coffee
  • jsdom
  • mocha
  • power-assert
  • uglify-js
npm test

Incomplete is test

License

MIT

© sugarshin