Skip to content

box-decoration-break

Utilities for controlling how element fragments should be rendered across multiple lines, columns, or pages.

Quick reference

ClassStyles
box-decoration-clonebox-decoration-break: clone;
box-decoration-slicebox-decoration-break: slice;

Source: https://tailwindcss.com/guide/box-decoration-break

Examples

Basic example

Use utilities like box-decoration-slice and box-decoration-clone to control how element fragments should be rendered across multiple lines, columns, or pages:

html
<span class="box-decoration-slice bg-linear-to-r from-indigo-600 to-pink-500 px-2 text-white ...">
  Hello<br />World
</span>
<span class="box-decoration-clone bg-linear-to-r from-indigo-600 to-pink-500 px-2 text-white ...">
  Hello<br />World
</span>

Responsive design

Prefix a box-decoration-break utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

html
<span class="box-decoration-clone md:box-decoration-slice ...">Lorem ipsum dolor sit amet...</span>

Learn more about using variants in the variants documentation.

Released under the MIT License.