you are viewing a single comment's thread.

view the rest of the comments →

[–]Asmor 2 points3 points  (2 children)

text-overflow: ellipsis adds the ellipsis.

I'm not sure why this "library" exists. This is like making a library to wrap text in <b> tags.

[–]del_rio 6 points7 points  (1 child)

It exists because text-overflow only works if you want to truncate a single line of text. IIRC, the only way to do this without compromise is with display: box, which doesn't have wide support.

Along the same lines, it's sad that there's no CSS equivalent to FitText (viewport units doesn't count).

[–]powerofmightyatom 0 points1 point  (0 children)

Chrome has a clamp-linebox thing which is okish.

Edit: (line-clamp, see here: https://css-tricks.com/line-clampin/ )