Skip to content

Add multi-line text truncation utilities #42889

Description

@Atibayounus

Prerequisites

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions