v156 · css · overflow & typography

CSS text-overflow: <string> value

For two decades, CSS line truncation offered only two blunt edges: clip (slice glyphs mid-stroke) or ellipsis (append a fixed …). CSS Overflow Level 4 brings text-overflow: "<string>" and two-value text-overflow: "<start-string>" "<end-string>" to Chromium, letting authors supply custom indicator strings such as " (more)", " ➔", " / …", or bidirectional scroll markers "‹ " " ›" directly in CSS without fragile pseudo-element overlays or JavaScript character measurement loops.

concepts

  1. Custom truncation markers

    Interactive string builder testing localized and semantic overflow tokens (" (more)", " ➔", " […]", "…(続き)") with a live container-width slider, CSS.supports('text-overflow', '" (more)"') + getComputedStyle serialization probe, and a side-by-side simulated preview when the current browser only supports keyword values.

  2. Two-value bidirectional scroll

    Interactive horizontal scroll container testing the two-value syntax text-overflow: "‹ " " ›". As you scroll horizontally through an overflowing inline line, CSS Overflow 4 independently renders the start-edge string when content overflows on the inline-start side and the end-edge string when content overflows on the inline-end side, paired with a live scrollLeft and edge-state readout.

  3. Breadcrumb & filepath condenser

    Practical developer workbench that condenses deep repository file paths and breadcrumbs using domain-specific markers (text-overflow: " / …" and text-overflow: "…/" " /…"), complete with accessible full-path keyboard disclosure and screen-reader parity verification.

why it shipped

Web applications routinely need truncation cues that carry more context than a generic three-dot ellipsis: news cards want " (more)" or localized equivalents like "…(続き)", command palettes and file trees need path delimiter hints like " / …", and horizontally scrollable pill bars benefit from two-value start/end overflow indicators ("‹ " " ›"). Previously, developers resorted to absolute-positioned gradient masks or resize-observer text splitting that broke selection, copy-paste, and bidirectional layout. Native text-overflow: <string> resolves truncation at paint/line-layout time while keeping the underlying DOM text intact for screen readers, find-in-page, and clipboard copy.

research record — use cases & exact surface

references