A Polymer 2 element for horizontally squishing text to stay within a max width.

[ This description is mirrored from README.md at github.com/SupportClass/sc-fitted-text on 2019-05-10 ]

<sc-fitted-text> Published on webcomponents.org Build Status Coverage Status Polymer 2 only

A Polymer 2 element for horizontally squishing text to stay within a max width.

Motivation

Broadcast graphics often need to ensure that text will fit within a given space. There are existing libraries out there that can reduce the font size of an element to fit a given space, but this behavior isn't always what is wanted. Sometimes, the design calls for horizontally squishing (scaling) the text, rather than reducing the font size. This element enables that.

Installation

bower install --save SupportClass/sc-fitted-text

Example

<sc-fitted-text text="Hello world!" max-width="100" align="center"></sc-fitted-text>

See the Demo page for an interactive example.

Install

Link to this version
ImportedReleased 17 April 2019MIT License
Framework Support
Polymer 2.0+
Browser Independent
Install with
bower install --save SupportClass/sc-fitted-text"#1.1.3"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 1.1.3

Dependencies

  • polymer#Polymer/polymer#^2.0.0