Add multi-line text truncation utilities
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 175k
- Forks
- 78.6k
- Avg merge
- 7h 19m
- Merged PRs (30d)
- 35
Description
Prerequisites
- I have searched for duplicate or closed feature requests
- I have read the contributing guidelines
Proposal
Bootstrap currently provides the .text-truncate utility for truncating text to a single line.
It would be useful to provide an optional utility for truncating text after multiple lines.
For example:
This is a long paragraph that should be truncated after two lines while preserving the responsive layout.
the css can be like .text-truncate-lines-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }Motivation and context
Multi-line text truncation is commonly needed in cards, product descriptions,
article previews, and responsive layouts.
Currently, developers need to write custom CSS for this behavior. A Bootstrap
utility could provide a consistent and reusable solution.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Bootstrap’s existing .text-truncate utility and review how utilities are documented and tested. Define a consistent multi-line truncation utility based on the proposed example, then verify that it truncates at the requested line count while preserving responsive layout behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100