Skip to content
English
Looks cramped07 / 71

Clamp long text

What it's calledLine clampmulti-line ellipsisGlossary

What goes wrong

Descriptions of one to five lines make every card a different height, so the row looks ragged and the footers never line up.

The fix

Cut previews to a fixed number of lines with an ellipsis, and let every card in a row take the same height.

Tell your AI

Clamp card descriptions to two lines with display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden, at var(--ds-font-size-sm) (13px) on var(--ds-line-height-sm) (20px); stretch the cards of a row to one height, push their footers down with margin-top: auto, and keep the full text for the detail page.

  • --ds-font-size-sm13px
  • --ds-line-height-sm20px
Why AI-generated UIs all look the same: 12 rules that fix it

  • Watercolour basics

    Paint loose skies.

    4 lessons€24
  • Sourdough at home

    Feed a starter, shape a loaf and bake an open, airy crumb in an ordinary home oven.

    8 lessons€39
  • Phone photography

    Frame, light and edit better shots with only your phone.

    5 lessons€29

Three cards, three heights