ember-shave

1.1.0 • Public • Published

ember-shave

A simple wrapper over DSC's super fast and simple text truncation library called shave.

Installation

ember install ember-shave

Usage

Code:

{{#em-shave ~}}
  Lorem ipsum dolor sit amet, minim molestie argumentum est at, pri legere torquatos instructior ex. Vis id odio atomorum oportere, quem modo fabellas sit at, dicat semper est ne. Apeirian detraxit pri eu. No solum accusam has. Ius ne harum mundi clita, eu pro tation audiam.
{{/em-shave}}

Result:

Lorem ipsum dolor sit…

Note: this contrived example assumes a width of 50px

Gotchas

  • Whitespace control: In Handlebars, Ember's templating language, whitespace control is done by appending a ~ to the opening tag of your components

  • Use block-style components: ember-shave assumes you've written your components using the block style. That is, this does not work: {{ em-shave text="Trim me!" }}

Other Implementations:

Readme

Keywords

Package Sidebar

Install

npm i ember-shave

Weekly Downloads

4

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dollarshaveclub-engineering