]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add .text-truncate class. We already had a mixin and documented the class, so this...
authorMark Otto <markdotto@gmail.com>
Sun, 2 Jul 2017 03:27:15 +0000 (20:27 -0700)
committerMark Otto <markd.otto@gmail.com>
Sun, 2 Jul 2017 06:05:51 +0000 (23:05 -0700)
docs/4.0/utilities/text.md
scss/utilities/_text.scss

index 32e11335dd08e8ea047942e910d835c63f8c3273..8dcbba078cb32d3e7277c169c692f8a36121cb26 100644 (file)
@@ -42,14 +42,20 @@ Prevent text from wrapping with a `.text-nowrap` class.
 </div>
 {% endexample %}
 
-For longer content, you can add a `.text-truncate` class to truncate the text with an ellipsis.
+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 html %}
+<!-- Block level -->
 <div class="row">
   <div class="col-2 text-truncate">
     Praeterea iter est quasdam res quas ex communi.
   </div>
 </div>
+
+<!-- Inline level -->
+<span class="d-inline-block text-truncate" style="max-width: 150px;">
+  Praeterea iter est quasdam res quas ex communi.
+</span>
 {% endexample %}
 
 ## Text transform
index 7f20ed76eee269c151d6fea49a673ed469d34ab0..8cbd0016ccb37d950de3cd4ca19f57ff4e2ba410 100644 (file)
@@ -47,3 +47,7 @@
 .text-hide {
   @include text-hide();
 }
+
+.text-truncate {
+  @include text-truncate();
+}