Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jhta/tailwindcss-truncate-multiline

Tailwind CSS plugin to generate truncate multiline utilities
https://github.com/jhta/tailwindcss-truncate-multiline

ellipsis line-clamping plugin tailwind truncate

Last synced: 2 months ago
JSON representation

Tailwind CSS plugin to generate truncate multiline utilities

Awesome Lists containing this project

README

        

# Truncate Multiline Plugin for Tailwind CSS

## Installation

```bash
npm install tailwindcss-truncate-multiline --save
```

or

```bash
yarn add tailwindcss-truncate-multiline
```

## Usage

```js
// tailwind.config.js
{
theme: {
truncate: {
lines: {
3: '3',
5: '5',
8: '8',
}
}

plugins: [
require('tailwindcss-truncate-multiline')(),
],
}
```

This plugin generates the following utilities:

```css
.truncate-[key]-lines {
'overflow': 'hidden',
'display': '-webkit-box',
'-webkit-line-clamp': [value],
'-webkit-box-orient': 'vertical',
}
```

## Variants:
You can also add variants:
```js
//tailwind.config.js
{
...
plugins: [
require('tailwindcss-truncate-multiline')(['responsive', 'hover']),
]
}