From 65ed0b759d4500a2d7aa7d41cc3b1a561723f4f0 Mon Sep 17 00:00:00 2001 From: Vincent Prothais Date: Fri, 2 Aug 2024 10:48:44 +0200 Subject: [PATCH] docs(helpers): add `Text truncation` page (#2670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julien Déramond --- site/content/docs/0.0/helpers/text-truncation.md | 16 +++++++++++++++- site/data/sidebar.yml | 1 - 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/site/content/docs/0.0/helpers/text-truncation.md b/site/content/docs/0.0/helpers/text-truncation.md index 0c844dc863..7dc3db147c 100644 --- a/site/content/docs/0.0/helpers/text-truncation.md +++ b/site/content/docs/0.0/helpers/text-truncation.md @@ -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 >}} + +
+
+ This text is quite long, and will be truncated once displayed. +
+
+ + + + This text is quite long, and will be truncated once displayed. + +{{< /example >}} diff --git a/site/data/sidebar.yml b/site/data/sidebar.yml index 62cdeb5694..4c2a0d8c98 100644 --- a/site/data/sidebar.yml +++ b/site/data/sidebar.yml @@ -203,7 +203,6 @@ - title: Stretched link draft: true - title: Text truncation - draft: true - title: Vertical rule draft: true - title: Visually hidden