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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tailwindcss-line-clamp-no-ellipsis

v0.2.3

Published

A tailwind plugin for line clamp without ellipsis.

Downloads

296

Readme

tailwindcss-line-clamp-no-ellipsis

這是一個不帶刪節號...,或稱為「省略號」)的文字段落截斷 Tailwind 插件。

此插件發想於 tailwind 的 tailwindlabs/tailwindcss-line-clamp 插件,此插件後來合併至 tailwind 核心套件。

大多數情況下,我們希望將文字段落以特定行數截斷,並在最後添加刪節號「...」。但有時我們希望截斷文字段落,而不帶刪節號。

範例

| | 原始 | 帶刪節號 | 不帶刪節號 | | ------------ | -------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------ | | Html | <div>...</div> | <div class="line-clamp-2">...</div> | <div class="line-clamp-no-ellipsis-2">...</div> | | 結果(英文) | en original | en with ellipsis | en without ellipsis | | 結果(中文) | ch original | ch with ellipsis | ch without ellipsis | | 結果(日文) | jp original | jp original | jp without ellipsis |

安裝

安裝插件:

npm install tailwindcss-line-clamp-no-ellipsis

tailwind.config.js 設定檔中,加入插件:

module.exports = {
  // ...
  plugins: [
    require('tailwindcss-line-clamp-no-ellipsis'),
    // ...
  ],
  // ...
}

使用方式

使用 CSS class 名稱 line-clamp-no-ellipsis-{截斷行數},「截斷行數」填入欲截斷的行數:

<div class="line-clamp-no-ellipsis-2">
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit eum illum modi nobis nisi similique quasi obcaecati, ipsa eos quaerat.
</div>

欲解除文字段落的截斷,使用line-clamp-no-ellipsis-none,範例如下:

<div class="line-clamp-no-ellipsis-2 md:line-clamp-no-ellipsis-none">
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit eum illum modi nobis nisi similique quasi obcaecati, ipsa eos quaerat.
</div>

插件提供的截斷選項為 1~6 行,所產生的 CSS 如下:

| Class | CSS | | ----------------------------- | --------------------------------------------------------------------------------------- | | line-clamp-no-ellipsis-1 | overflow: hidden; max-height: calc(1lh * 1); overflow-wrap: break-word; | | line-clamp-no-ellipsis-2 | overflow: hidden; max-height: calc(1lh * 2); overflow-wrap: break-word; | | line-clamp-no-ellipsis-3 | overflow: hidden; max-height: calc(1lh * 3); overflow-wrap: break-word; | | line-clamp-no-ellipsis-4 | overflow: hidden; max-height: calc(1lh * 4); overflow-wrap: break-word; | | line-clamp-no-ellipsis-5 | overflow: hidden; max-height: calc(1lh * 5); overflow-wrap: break-word; | | line-clamp-no-ellipsis-6 | overflow: hidden; max-height: calc(1lh * 6); overflow-wrap: break-word; | | line-clamp-no-ellipsis-none | overflow: unset; max-height: unset; |

客製化

若要使用 6 行以上的截斷,請在 tailwind.config.js 設定檔中,於 lineClamp 鍵底下,新增更多的行數選項,如下所示:

module.exports = {
  theme: {
    extend: {
      lineClamp: {
        7: '7',
        8: '8',
      }
    }
  },
}

加入後,即可馬上使用!

<div class="line-clamp-no-ellipsis-7">
  Lorem ipsum dolor sit amet consectetur adipisicing elit. Sit eum illum modi nobis nisi similique quasi obcaecati, ipsa eos quaerat.
</div>