aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-07-01 20:27:15 -0700
committerMark Otto <[email protected]>2017-07-01 23:05:51 -0700
commit6f073edc791c63ad0f93ba9845de35e0f7e2f2ff (patch)
treea02307104b9fe431f0c862a33d1873d52bf5f079
parentcfb383cc0190f099bbe6c8cecd8ecffa23e0bb7c (diff)
downloadbootstrap-6f073edc791c63ad0f93ba9845de35e0f7e2f2ff.tar.xz
bootstrap-6f073edc791c63ad0f93ba9845de35e0f7e2f2ff.zip
Add .text-truncate class. We already had a mixin and documented the class, so this fixes that.
-rw-r--r--docs/4.0/utilities/text.md8
-rw-r--r--scss/utilities/_text.scss4
2 files changed, 11 insertions, 1 deletions
diff --git a/docs/4.0/utilities/text.md b/docs/4.0/utilities/text.md
index 32e11335d..8dcbba078 100644
--- a/docs/4.0/utilities/text.md
+++ b/docs/4.0/utilities/text.md
@@ -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
diff --git a/scss/utilities/_text.scss b/scss/utilities/_text.scss
index 7f20ed76e..8cbd0016c 100644
--- a/scss/utilities/_text.scss
+++ b/scss/utilities/_text.scss
@@ -47,3 +47,7 @@
.text-hide {
@include text-hide();
}
+
+.text-truncate {
+ @include text-truncate();
+}