Word Break
Word break utilities set word-break. They are the last line of defence against
a long URL or an unbroken identifier pushing a layout wider than its container.
Classes
Section titled “Classes”| Class | word-break |
|---|---|
word-break-normal |
normal |
word-break-break-all |
break-all |
word-break-keep-all |
keep-all |
word-break-break-word |
break-word |
<p class="word-break-break-all">https://example.com/a/very/long/path/that/does/not/fit</p>Responsive word break
Section titled “Responsive word break”<p class="word-break-normal word-break-md-break-word">Wraps only when narrow</p>Responsive: word-break-sm-break-all … word-break-2xl-keep-all.
These classes are in the separate responsive module: import
nightcss/utilities/responsive after the base bundle, or use
nightcss/full.
Guidance
Section titled “Guidance”break-allcan break a word at any character. Use it for code, hashes, and URLs, not for prose.break-wordonly breaks a word when it would otherwise overflow; it is the gentler option for user-generated text.keep-allprevents breaks between CJK characters. It is not a general “do not wrap” switch; use White Space for that.- For a single line with an ellipsis, use Truncation.