npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tailwindcss-plugin-multiple-lines

v1.0.1

Published

A Tailwind CSS plugin for adding multiple-line truncation

Downloads

28

Readme

Tailwindcss Plugin: Multiple Line

This plugin adds helpers for the css line-clamp property that truncates text at a specific number of lines within TailwindCSS.

The plugin was inspired by the CSS-Ticks Article.

Installation

Add this plugin to your project

  npm install tailwindcss-plugin-multiple-lines --save-dev

Usage

This plugin generate styles for the line-clamp CSS Property

This plugin accepts following options:

  • lineClamp The Number of lines that should be generated. The default are [1,...,10]

Here is an example how to add this plugin to your project

// tailwind.config.js
const multipleLinesPlugin = require('tailwindcss-plugin-multiple-lines');

module.exports = {
  theme: {
    extend: {}
  },
  variants: {},
  plugins: [
    multipleLinesPlugin()
  ]
};

The default configuration would create the following classes: The classes .clamp-0 through .clamp-9 are also generated with the responsive prefix.

.clamp-0 {
    -webkit-line-clamp: unset
}
       
.clamp-1 {
  -webkit-line-clamp: 1
}

.clamp-2 {
  -webkit-line-clamp: 2
}

.clamp-3 {
  -webkit-line-clamp: 3
}

.clamp-4 {
  -webkit-line-clamp: 4
}

.clamp-5 {
  -webkit-line-clamp: 5
}

.clamp-6 {
  -webkit-line-clamp: 6
}

.clamp-7 {
  -webkit-line-clamp: 7
}

.clamp-8 {
  -webkit-line-clamp: 8
}

.clamp-9 {
  -webkit-line-clamp: 9
}

.box {
  display: -webkit-box;
}

.orient-vertical {
  -webkit-box-orient: vertical
}

.orient-horizontal {
  -webkit-box-orient: horizontal
}

.orient-axis-block {
  -webkit-box-orient: block-axis
}

.orient-inline-block {
  -webkit-box-orient: block-inline
}

.orient-unset {
  -webkit-box-orient: unset
}

Example

Example

<div class="mx-auto md:max-w-2xl flex bg-white rounded-lg shadow-lg overflow-hidden mt-32 px-8 py-10">
    <p class="box clamp-5 sm:clamp-4 md:clamp-3 orient-vertical overflow-hidden leading-relaxed">
       Lorem ipsum dolor sit amet, consectetur adipisicing elit. 
       Consectetur dicta dolores earum exercitationem, in magni optio pariatur 
       repellat sapiente voluptas. Adipisci debitis ducimus ex id, iure maiores 
       nostrum odit, placeat ratione sapiente soluta temporibus voluptatem voluptatibus. 
       Aperiam aut explicabo, iure numquam porro quam quod quos ratione saepe sed?
    </p>
</div>

Testing

To run the tests

npm run test

Licence

MIT