Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flowtype-es

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowtype-es

No Library version of FlowType.js

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ES6 FlowType.js

Build Status

FlowType ES is a rewrite of the awesome FlowType.JS in ES6. It doesn't require jQuery and triggers recalculation on requestAnimationFrame.

Install

npm install flowtype-es

API

import createFlowtype from "flowtype-es";

const flowtype = createFlowtype(element, options)

Creates and attaches event listeners for automatic recalculation of the font size upon resizing the element.

  • element is a reference to the dom element for which the font size should be calculated automatically.
  • options lets you customize the calculation of the font size.

Returns an object with update() and destroy().

flowtype.update()

Triggers a recalculation of the font size.

flowtype.destroy()

Removes all event listeners and stops the automatic recalculation of the font size upon resizing the element.

Options

OptionDescriptionDtypeDefault
maximumMax width of the element until the font size is controlledint1200
minimumMin width of the element until the font size is controlledint500
maxFontMax font size ever usedint40
minFontMin font size ever usedint12
fontRatioFont ratio for determining the font size based on the elements's widthint30

Example

import createFlowtype from "flowtype-es";

const flowtype = createFlowtype(document.body, {
  maximum: 1200,
  minimum: 500,
  maxFont: 40,
  minFont: 12,
  fontRatio: 30
});

Keywords

FAQs

Package last updated on 24 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc