Pure CSS Line Clamp Toggle
I’m currently working on a frontend project at work currently that involves building out a library of Twig components for a large website running on Drupal. The mobile designs for the component I’m working on today require that if the description field has more than one paragraph, only the first 2 lines of the first paragraph should be displayed along with a basic toggle switch so a user can read more if they want. There are multiple ways to approach this, but I wanted to come up with a pure CSS solution without using any javascript. Read more to see what I came up with!