Skip to content

Commit 4415614

Browse files
authored
Add .break-word (#803)
1 parent 9877070 commit 4415614

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

docs/_data/typography.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@
234234
"define": "Unsets any inherited behavior. Does not work in IE."
235235
},
236236
{
237-
"class": "ww-break-word",
238-
"output": "word-wrap: break-word;",
239-
"define": "Deprecated, please use the equivalent ow-break-word instead. Specifies if a browser should insert line breaks within words to prevent text from overflowing its content box."
237+
"class": "break-word",
238+
"output": "word-break: break-word; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto;",
239+
"define": "A utility class combining all word-break strategies when you absolutely must break a word."
240240
},
241241
{
242242
"class": "wb-normal",

docs/product/base/typography.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<p class="ws-pre-line">White-space: Pre-line</p>
114114
<p class="ws-unset">White-space: Unset</p>
115115

116-
<p class="ow-break-word">Break word</p>
116+
<p class="break-word">Break word</p>
117117

118118
<p class="truncate">Truncate: …</p>
119119
{% endhighlight %}
@@ -129,7 +129,7 @@
129129
<p class="flex--item ws-pre-wrap"><strong>White-space:</strong> Pre-wrap</p>
130130
<p class="flex--item ws-pre-line"><strong>White-space:</strong> Pre-line</p>
131131
<p class="flex--item ws-unset mb32"><strong>White-space:</strong> Unset</p>
132-
<p class="flex--item ow-break-word mb32"><strong>Word Wrap:</strong> Break word</p>
132+
<p class="flex--item break-word mb32"><strong>Break word:</strong> MethionylglutaminylarginylhionylglutaminylargintyrosylglutamylmethionylglutaminylarginyltyrlarginyltyrosylglutamylMethionylglutaminylarginyltyrosylglutamylnyltyrosylserinemethionylglutaminylargiglutamylmethionyosylglutamylmethionylglutaminylglutaminylarginyltyrosylglutamylmethionylglutaminylarginyltyrosylglutamylmetyltyrosylglutamylserine</p>
133133
</div>
134134
</div>
135135
</section>

lib/css/atomic/_stacks-typography.less

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ p {
194194
.wb-unset { word-break: unset !important; }
195195

196196
// -- Overflow Wrap
197-
// This property will create a line break only if an entire word cannot be
198-
// placed on its own line without overflowing. This was formerly called
199-
// word-wrap, which was an unprefixed Microsoft vendor property implemented
200-
// by most browsers. Word-wrap is still a supported alias, but can be removed
201-
// once we no longer support IE11.
202197
.ow-normal {
203198
overflow-wrap: normal !important;
204199
word-wrap: normal !important;
@@ -224,8 +219,6 @@ p {
224219
word-wrap: unset !important;
225220
}
226221

227-
.ww-break-word { word-wrap: break-word !important; }
228-
229222
// -- Hyphenation
230223
.hyphens-none { hyphens: none !important; }
231224
.hyphens-auto {
@@ -235,6 +228,17 @@ p {
235228
}
236229
.hyphens-unset { hyphens: unset !important; }
237230

231+
// -- Break word
232+
.break-word {
233+
word-break: break-word !important;
234+
word-wrap: break-word !important;
235+
overflow-wrap: break-word !important;
236+
-webkit-hyphens: auto !important;
237+
-moz-hyphens: auto !important;
238+
-ms-hyphens: auto !important;
239+
hyphens: auto !important;
240+
}
241+
238242
// ============================================================================
239243
// $ LISTS
240244
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)