Skip to main content

decoration

Radius, shadow, and border

Corner radii, the shadow set, the inner-border utility, and the mask utilities, each with its syntax and a live sample.

Shadows are shown on paper, where they read. The ambient shadows (shadow-sm, -md, -lg) spread evenly at 50% black, which makes them visible on the dark ground too. The directional ones (-t-, -r-, -b-, -l-) cast toward one edge, for drawers and bars that sit against it.

Radius

  • rounded 0.25rem
  • rounded-lg 0.5rem
  • rounded-xl 0.75rem

Shadow

  • shadow-b-lg 0 10px 12px -3px rgb(0 0 0 / 0.1)
  • shadow-b-md 0 4px 8px -1px rgb(0 0 0 / 0.1)
  • shadow-b-sm 0 1px 4px 0 rgb(0 0 0 / 0.05)
  • shadow-l-lg -10px 0 12px -3px rgb(0 0 0 / 0.1)
  • shadow-l-md -4px 0 8px -1px rgb(0 0 0 / 0.1)
  • shadow-l-sm -1px 0 4px 0 rgb(0 0 0 / 0.05)
  • shadow-lg 0 0 12px 0 rgb(0 0 0 / 0.5)
  • shadow-md 0 0 8px 0 rgb(0 0 0 / 0.5)
  • shadow-r-lg 10px 0 12px -3px rgb(0 0 0 / 0.1)
  • shadow-r-md 4px 0 8px -1px rgb(0 0 0 / 0.1)
  • shadow-r-sm 1px 0 4px 0 rgb(0 0 0 / 0.05)
  • shadow-sm 0 0 4px 0 rgb(0 0 0 / 0.5)
  • shadow-t-lg 0 -10px 12px -3px rgb(0 0 0 / 0.1)
  • shadow-t-md 0 -4px 8px -1px rgb(0 0 0 / 0.1)
  • shadow-t-sm 0 -1px 4px 0 rgb(0 0 0 / 0.05)
  • shadow-xl 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)

Inner border

A rule inset from the edge on ::after, so it paints over children with solid backgrounds. Width in whole px or an arbitrary length (inner-border-[0.5px] for hairlines).

inner-border · inner-border-<color> · inner-border-<px> · inner-border-inset-<step> · inner-border-dashed | dotted | double · styles/decorations.css

  • inner-border
  • inner-border inner-border-primary-400 inner-border-2
  • inner-border inner-border-accent-400 inner-border-inset-4 inner-border-dashed

Masks

Each utility sets one mask property, with its -webkit- twin, so they combine in any order and take variants. They are defined in styles/utilities/mask.css.

mask-image
mask-image-grunge · mask-image-gradient-vertical · mask-image-gradient-horizontal · mask-image-radial The mask itself. The grunge image is a luminance mask; the gradients run white to black, top to bottom, left to right, or from the centre out.
mask-mode
mask-mode-luminance · mask-mode-alpha Whether the mask reads brightness or transparency. The gradients are opaque, so they only show under luminance.
mask-size
mask-size-auto · mask-size-cover · mask-size-contain How large the mask is drawn.
mask-position
mask-position-center · mask-position-top · mask-position-bottom · mask-position-left · mask-position-right Where the mask sits.
mask-repeat
mask-repeat-repeat · mask-repeat-no-repeat · mask-repeat-repeat-x · mask-repeat-repeat-y Whether and along which axis the mask tiles.
mask-clip
mask-clip-border · mask-clip-padding · mask-clip-content · mask-clip-text Which box the mask is clipped to.
mask-composite
mask-composite-add · mask-composite-subtract · mask-composite-intersect · mask-composite-exclude How stacked masks combine.

Gradient masks

A filled block fading out along the mask. The fill is set with an important modifier so it shows over the sample's dark ground.

mask-image-gradient-vertical · mask-image-gradient-horizontal · mask-image-radial, with mask-mode-luminance · styles/utilities/mask.css

  • bg-primary-500! mask-image-gradient-vertical mask-mode-luminance
  • bg-primary-500! mask-image-gradient-horizontal mask-mode-luminance
  • bg-primary-500! mask-image-radial mask-mode-luminance

Mask mode

The same gradient under each mode. Luminance fades the block; alpha leaves it whole, because the gradient is opaque.

mask-mode-luminance · mask-mode-alpha · styles/utilities/mask.css

  • bg-primary-500! mask-image-gradient-vertical mask-mode-luminance
  • bg-primary-500! mask-image-gradient-vertical mask-mode-alpha

Grunge mask and size

The grunge image is 2730 by 615 pixels, so size shows. Auto draws it at full size, so the block shows one corner of it. Cover scales it to fill the block and crops the sides. Contain scales it to fit the width and, with no-repeat, leaves the rest of the block empty. The gradients have no intrinsic size, so these three look the same on them.

mask-image-grunge, with mask-size-auto · mask-size-cover · mask-size-contain · styles/utilities/mask.css

  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-auto
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-cover
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-contain

Mask position

Position moves a mask that doesn't fill the block. Top, center and bottom move the contained grunge image, which is shorter than the block. Left and right pick which end of the full-size image shows.

mask-position-top · mask-position-center · mask-position-bottom, and mask-position-left · mask-position-right · styles/utilities/mask.css

  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-contain mask-position-top
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-contain mask-position-center
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-contain mask-position-bottom
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-auto mask-position-left
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-repeat-no-repeat mask-size-auto mask-position-right

Mask repeat

The contained grunge image is shorter than the block. Repeat tiles it down the block, no-repeat draws it once, and repeat-y tiles along the vertical axis only. Repeat-x looks the same as no-repeat here, because contain already fills the width.

mask-repeat-repeat · mask-repeat-no-repeat · mask-repeat-repeat-y · styles/utilities/mask.css

  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-size-contain mask-repeat-repeat
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-size-contain mask-repeat-no-repeat
  • bg-primary-500! mask-image-grunge mask-mode-luminance mask-size-contain mask-repeat-repeat-y

Mask clip

A bordered, padded block under the vertical gradient. Border keeps the border in the mask, padding cuts it away, and content trims the padding too. Mask-clip-text clips to the text of an element with a text background and isn't sampled. Mask-composite needs two stacked masks and each utility sets only one, so it stays syntax.

mask-clip-border · mask-clip-padding · mask-clip-content · styles/utilities/mask.css

  • bg-primary-500! border-8 border-accent-400 p-4 mask-image-gradient-vertical mask-mode-luminance mask-clip-border
  • bg-primary-500! border-8 border-accent-400 p-4 mask-image-gradient-vertical mask-mode-luminance mask-clip-padding
  • bg-primary-500! border-8 border-accent-400 p-4 mask-image-gradient-vertical mask-mode-luminance mask-clip-content