Oh Hey! My First NPM Package

I just published my first NPM package!

It’s a fairly simple module to add a height based JavaScript fallback for -webkit-line-clamp on browsers that don’t support it (i.e., Firefox and IE). I came across a case at work where we needed cross-browser line clamping with different line counts depending on the breakpoint and with consistent rendering even with web fonts on mobile devices. We tried a few existing JS truncation libraries but sometimes you want the CSS to do the heavy lifting.

The module is called Clamps (because my names are often Futurama inspired) and you can check it out on NPM or Github.

Hit me up with all your issues; they’re still new and exciting to me!