Docs / Word Break

Word Break

vel-src: typography.css

Utilities for controlling word breaks and overflow wrapping in text.

ClassProperties
vel-break-normaloverflow-wrap: normal; word-break: normal
vel-break-wordsoverflow-wrap: break-word
vel-break-allword-break: break-all
vel-break-keepword-break: keep-all

Examples

Break long words to prevent overflow

Thisisaverylongwordthatwouldhaveoverflowedthecontainerbutnowitbreaksproperly
example.html
<div class="vel-break-words" style="width:12rem;background:#0d1422;border:1px solid #1e2d45;border-radius:0.5rem;padding:1rem;color:#e2e8f0">
  Thisisaverylongwordthatwouldhaveoverflowedthecontainerbutnowitbreaksproperly
</div>

Break all characters (aggressive)

Break at any character boundary. Even mid-word if needed.
example.html
<div class="vel-break-all" style="width:12rem;background:#0d1422;border:1px solid #1e2d45;border-radius:0.5rem;padding:1rem;color:#e2e8f0">
  Break at any character boundary. Even mid-word if needed.
</div>

Normal word breaking (default)

Normal word breaking — only breaks at word boundaries.
example.html
<div class="vel-break-normal" style="width:12rem;background:#0d1422;border:1px solid #1e2d45;border-radius:0.5rem;padding:1rem;color:#e2e8f0;overflow:auto">
  Normal word breaking — only breaks at word boundaries.
</div>