Skip to content

Commit

Permalink
docs(helpers): add Text truncation page (#2670)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Déramond <[email protected]>
  • Loading branch information
vprothais and julien-deramond authored Aug 2, 2024
1 parent 49b7a40 commit 65ed0b7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 15 additions & 1 deletion site/content/docs/0.0/helpers/text-truncation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,18 @@ aliases:
toc: false
---

{{< callout-soon "helper" >}}
For longer content, you can add a `.text-truncate` class to truncate the text with an ellipsis. **Requires `display: inline-block` or `display: block`.**

{{< example >}}
<!-- Block level -->
<div class="row">
<div class="col-2 text-truncate">
This text is quite long, and will be truncated once displayed.
</div>
</div>

<!-- Inline level -->
<span class="d-inline-block text-truncate" style="max-width: 150px;">
This text is quite long, and will be truncated once displayed.
</span>
{{< /example >}}
1 change: 0 additions & 1 deletion site/data/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
- title: Stretched link
draft: true
- title: Text truncation
draft: true
- title: Vertical rule
draft: true
- title: Visually hidden
Expand Down

0 comments on commit 65ed0b7

Please sign in to comment.