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

adaptable-text

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adaptable-text

Adapt font size to a specified width.

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

adaptable-text

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Adapt font size to a specified width.

paypal coinbase twitter

Installation

npm install adaptable-text

Usage

import adaptableText from "adaptable-text";
console.log(adaptableText);

API

Classes

AdaptableText

Typedefs

Options : Object

AdaptableText

Kind: global class

new AdaptableText(element, [options])

Creates an instance of AdaptableText.

ParamType
elementHTMLElement
[options]Options

adaptableText.init()

Initialise the adaptor.

Kind: instance method of AdaptableText

adaptableText.setWidth()

Set the desired width for adaptation from options.width or getBoundingClientRect().width

Kind: instance method of AdaptableText

adaptableText.adapt()

Adapt font size to a specified width

Kind: instance method of AdaptableText

Options : Object

Kind: global typedef
Properties

NameTypeDefaultDescription
[step]number0.5The step used by the generator to calculate the width of the element.
[minFontSize]number0A minimum font size for the element (max would be the size defined in a stylesheet retrieved by window.getComputedStyle(this.element)).
[width]numberA maximum widht for the container..

License

MIT. See license file.

Keywords

FAQs

Package last updated on 10 Apr 2021

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