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

ember-resize-text

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-resize-text

ember addon that makes use of ember-text-measurer to efficiently resize the font of a single line of text to make it fit within its bounds

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52
increased by30%
Maintainers
1
Weekly downloads
 
Created
Source

ember-resize-text

Greenkeeper badge Latest NPM release TravisCI Build Status Code Climate Ember Observer Score Dependencies Dev Dependencies

ember addon that makes use of ember-text-measurer to efficiently resize the font of a single line of text to make it fit within its bounds.

Installation

ember install ember-resize-text

Demo

checkout out the demo page

Usage

Using ember-resize-text is easy. Just wrap your text within resize-text block-style.

{{#resize-text minSize=12 maxSize=20}}
  Please resize me!
{{/resize-text}}

Notice on resizing the window

This addon automatically registers event listeners on the windows resize event to make sure text still fits after the window is resized. If you want the text to increase its font size whenever the window is resized, make sure to add the appropriate styling to the add-ons resize-text css class. For instance consider this markup:

<nav>
  <span>first</span>
  {{#resize-text}}
    second
  {{/resize-text}}
</nav>

and the following css:

nav {
  width: 100%;
  display: flex
}

.resize-text {
  flex-grow: 1; /* allow the resize-text elements to increase its size */
}

The size of the font will not be increased if the element with resize-text class will not be able to increase its width in dependency to the parent's width. This is not built into the addon as this depends on the context in which the addon is used.

Parameters

  • minSize: minimum font size in px
  • maxSize: maximum font size in px

Contribute

Please open issues to discuss further improvement of this add on. Corresponding PRs are very welcome!

Keywords

FAQs

Package last updated on 20 Dec 2017

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