Gathering detailed insights and metrics for @tailwindcss/line-clamp
Gathering detailed insights and metrics for @tailwindcss/line-clamp
Gathering detailed insights and metrics for @tailwindcss/line-clamp
Gathering detailed insights and metrics for @tailwindcss/line-clamp
tailwindcss-line-clamp
TailwindCSS plugin to generate webkit line clamp utilities
@neojp/tailwindcss-line-clamp-utilities
Tailwind CSS `line-clamp` utilities
postcss-clamp
PostCSS plugin to transform clamp() to combination of min/max
@twind/preset-line-clamp
A twind preset that provides utilities for visually truncating text after a fixed number of lines.
A plugin that provides utilities for visually truncating text after a fixed number of lines.
npm install @tailwindcss/line-clamp
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,179 Stars
63 Commits
36 Forks
13 Watching
1 Branches
14 Contributors
Updated on 26 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.8%
82,498
Compared to previous day
Last week
0.2%
435,891
Compared to previous week
Last month
8.2%
1,848,382
Compared to previous month
Last year
-13.7%
22,001,134
Compared to previous year
1
4
A plugin that provides utilities for visually truncating text after a fixed number of lines.
Warning As of Tailwind CSS v3.3 the
line-clamp
utilities are now included in the framework by default and this plugin is no longer required.
Install the plugin from npm:
1npm install -D @tailwindcss/line-clamp
Then add the plugin to your tailwind.config.js
file:
1// tailwind.config.js 2module.exports = { 3 theme: { 4 // ... 5 }, 6 plugins: [ 7 require('@tailwindcss/line-clamp'), 8 // ... 9 ], 10}
Use the line-clamp-{n}
utilities to specify how many lines of text should be visible before truncating:
1<p class="line-clamp-3"> 2 Et molestiae hic earum repellat aliquid est doloribus delectus. Enim illum odio porro ut omnis dolor debitis natus. Voluptas possimus deserunt sit delectus est saepe nihil. Qui voluptate possimus et quia. Eligendi voluptas voluptas dolor cum. Rerum est quos quos id ut molestiae fugit. 3</p>
To remove any line-clamping, use line-clamp-none
:
1<p class="line-clamp-3 md:line-clamp-none"> 2 Et molestiae hic earum repellat aliquid est doloribus delectus. Enim illum odio porro ut omnis dolor debitis natus. Voluptas possimus deserunt sit delectus est saepe nihil. Qui voluptate possimus et quia. Eligendi voluptas voluptas dolor cum. Rerum est quos quos id ut molestiae fugit. 3</p>
Note that the
line-clamp-{n}
set other properties likedisplay
andoverflow
in addition to-webkit-line-clamp
which are not unset byline-clamp-none
, so depending on what you are trying to achieve you may need to explicitly override those properties with utilities likeflex
oroverflow-visible
as well.
Utilities are for clamping text up to 6 lines are generated by default:
Class | CSS |
---|---|
line-clamp-1 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; |
line-clamp-2 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; |
line-clamp-3 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; |
line-clamp-4 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; |
line-clamp-5 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; |
line-clamp-6 | overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; |
line-clamp-none | -webkit-line-clamp: unset; |
You can configure which values and variants are generated by this plugin under the lineClamp
key in your tailwind.config.js
file:
1// tailwind.config.js 2module.exports = { 3 theme: { 4 extend: { 5 lineClamp: { 6 7: '7', 7 8: '8', 8 9: '9', 9 10: '10', 10 } 11 } 12 }, 13 variants: { 14 lineClamp: ['responsive', 'hover'] 15 } 16}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More