Clamps Demo

Clamps is a lightweight JavaScript module that mimics the -webkit-line-clamp CSS property on browsers that don't natively support it (Can I use details). To get the most out of this demo, open the page on a browser without support like Firefox or IE and compare the results with Chrome or Safari.

View on Github

Basic Usage

OK, this has gotta stop. I'm going to remind Fry of his humanity the way only a woman can. Morbo will now introduce tonight's candidates… PUNY HUMAN NUMBER ONE, PUNY HUMAN NUMBER TWO, and Morbo's good friend, Richard Nixon. Oh, all right, I am. But if anything happens to me, tell them I died robbing some old man. Son, as your lawyer, I declare y'all are in a 12-piece bucket o' trouble. But I done struck you a deal: Five hours of community service cleanin' up that ol' mess you caused. Are you crazy? I can't swallow that. Come, Comrade Bender! We must take to the streets! So I really am important? How I feel when I'm drunk is correct? This is the worst part. The calm before the battle.

With nested DOM nodes

When I was first asked to make a film about my nephew, Hubert Farnsworth, I thought "Why should I?" Then later, Leela made the film. But if I did make it, you can bet there would have been more topless women on motorcycles. Roll film! With a warning label this big, you know they gotta be fun! Oh, how I wish I could believe or understand that! There's only one reasonable course of action now: kill Flexo! I love this planet! I've got wealth, fame, and access to the depths of sleaze that those things bring. Yes, if you make it look like an electrical fire. When you do things right, people won't be sure you've done anything at all.

With :nth-child and breakpoints

Example robot photo
In your time, yes, but nowadays shut up! Besides, these are adult stem cells, harvested from perfectly healthy adults whom I killed for their stemcells. Yeah, lots of people did. Wow, you got that off the Internet?
Example robot photo
I'll get my kit! Actually, that's still true. I usually try to keep my sadness pent up inside where it can fester quietly as a mental illness. Say what? This is the worst kind of discrimination: the kind against me!
Example robot photo
Meh. Hello Morbo, how's the family? Well, thanks to the Internet, I'm now bored with sex. Is there a place on the web that panders to my lust for violence? How much did you make me? No, just a regular mistake.
Example robot photo
Also Zoidberg. Good news, everyone! There's a report on TV with some very bad news! Hey, what kinda party is this? There's no booze and only one hooker. Who's brave enough to fly into something we all keep calling a death sphere?
Example robot photo
Yes, except the Dave Matthews Band doesn't rock. Humans dating robots is sick. You people wonder why I'm still single? It's 'cause all the fine robot sisters are dating humans!
Example robot photo
You can crush me but you can't crush my spirit! Oh, I think we should just stay friends. Yeah, and if you were the pope they'd be all, "Straighten your pope hat." And "Put on your good vestments." Quite possible. We live long and are celebrated poopers.
Example robot photo
Guards! Bring me the forms I need to fill out to have her taken away! Dear God, they'll be killed on our doorstep! And there's no trash pickup until January 3rd. So, how 'bout them Knicks? Look, last night was a mistake.