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

ember-cli-clamp

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-clamp

ember-cli component addon for clamp.js

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
3
Weekly downloads
 
Created
Source

ember-cli-clamp

ember-cli addon for clamp.js: https://github.com/josephschmitt/Clamp.js

##Notes

  • Allows for Clamp.js's clamp option by using the lines attribute (see examples below)
  • Disables Clamp.js's useNativeClamp because native clamping produces unsatisfactory results
  • Listens for window resize events and re-renders truncated text.

##Caveats

  • Loading webfonts after rendering can change the number of characters that should be truncated. A valid workaround is to use an initializer for loading webfonts, thus guaranteeing that the clamping will occur after the content is done rendering.

##Basic usage The default number of lines is 2.

{{#clamp-js}}
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel placerat magna. Pellentesque accumsan lobortis aliquam. Vestibulum feugiat pellentesque nisi, nec fringilla felis bibendum non. Nulla quis vulputate sapien. Vivamus id nibh eu ipsum fermentum sollicitudin at vitae sapien. Cras a convallis turpis. Donec finibus mauris vel risus vulputate tempus. Vivamus nulla diam, porta quis tempus sed, dictum id felis. Praesent dignissim hendrerit facilisis. In scelerisque elit at nunc consectetur consectetur. Nulla facilisi. Vestibulum in orci nec diam consequat molestie non eu massa. Ut interdum vestibulum sem lobortis commodo. Aenean dictum, urna sit amet condimentum ornare, nisi enim ultricies lacus, sed placerat risus neque a tellus. Suspendisse non mauris quam.
{{/clamp-js}}

##With declared number of lines

{{#clamp-js lines=3}}
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel placerat magna. Pellentesque accumsan lobortis aliquam. Vestibulum feugiat pellentesque nisi, nec fringilla felis bibendum non. Nulla quis vulputate sapien. Vivamus id nibh eu ipsum fermentum sollicitudin at vitae sapien. Cras a convallis turpis. Donec finibus mauris vel risus vulputate tempus. Vivamus nulla diam, porta quis tempus sed, dictum id felis. Praesent dignissim hendrerit facilisis. In scelerisque elit at nunc consectetur consectetur. Nulla facilisi. Vestibulum in orci nec diam consequat molestie non eu massa. Ut interdum vestibulum sem lobortis commodo. Aenean dictum, urna sit amet condimentum ornare, nisi enim ultricies lacus, sed placerat risus neque a tellus. Suspendisse non mauris quam.
{{/clamp-js}}

##With declared height

{{#clamp-js lines="100px"}}
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel placerat magna. Pellentesque accumsan lobortis aliquam. Vestibulum feugiat pellentesque nisi, nec fringilla felis bibendum non. Nulla quis vulputate sapien. Vivamus id nibh eu ipsum fermentum sollicitudin at vitae sapien. Cras a convallis turpis. Donec finibus mauris vel risus vulputate tempus. Vivamus nulla diam, porta quis tempus sed, dictum id felis. Praesent dignissim hendrerit facilisis. In scelerisque elit at nunc consectetur consectetur. Nulla facilisi. Vestibulum in orci nec diam consequat molestie non eu massa. Ut interdum vestibulum sem lobortis commodo. Aenean dictum, urna sit amet condimentum ornare, nisi enim ultricies lacus, sed placerat risus neque a tellus. Suspendisse non mauris quam.
{{/clamp-js}}

Keywords

FAQs

Package last updated on 29 Mar 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