{
  "id": "line-clamp",
  "name": "Multi-line Truncate",
  "category": "text",
  "tags": [
    "line-clamp",
    "truncate",
    "ellipsis",
    "overflow",
    "excerpt"
  ],
  "description": "Cut text off after a set number of lines and end it with an ellipsis.",
  "url": "https://copy-css.com/snippets/line-clamp",
  "markdown": "https://copy-css.com/snippets/line-clamp.md",
  "html": "<p class=\"clamp\">CSS can trim long text to a set number of lines and add an ellipsis at the end. There is no JavaScript and no measuring, and it keeps working as the container resizes.</p>",
  "css": ".clamp {\n  --lines: 3;\n  display: -webkit-box;\n  -webkit-box-orient: vertical;\n  -webkit-line-clamp: var(--lines);\n  line-clamp: var(--lines);\n  overflow: hidden;\n}",
  "features": [
    "line clamping",
    "custom properties"
  ],
  "customProperties": [
    {
      "name": "--lines",
      "value": "3"
    }
  ]
}
