Selection background swatch
The selection variant lets a component specify its own selected-text colours. Readability depends on the selected foreground as well as the highlight.
Developer journal
Utility-first approaches to responsive components, sizing and visual states.
The selection variant lets a component specify its own selected-text colours. Readability depends on the selected foreground as well as the highlight.
A skew utility changes the painted shape without allocating extra room for the slanted edge. A separate inner wrapper can keep lettering upright.
Flex utilities define the row but children can still resist shrinking. Inspect long labels before adding more breakpoints.
A perforated divider can use an arbitrary background value when a standard border lacks the desired spacing. Keep the pattern in one reusable class list.
A max-width utility constrains a reading column even when its parent occupies the whole viewport. Font size still determines how many characters fit.
Selection utilities can restore copying on one field inside a larger interactive card. Apply the exception to the exact text the reader needs.
A background colour with an alpha component preserves the opacity of text and icons. This is particularly useful for labels over photographs.
Breakpoint variants apply according to viewport width. Verify which label remains available to assistive technology when switching presentations.
Marker variants style the list marker separately from its text. They let a dense procedure retain a clear reading hierarchy.
The box-content utility deliberately sizes the inner area. This can help when reproducing a measured content region with a separate frame.
Minimum width belongs to the element that must remain usable. A minimum on a parent can unnecessarily force the entire page to scroll.
The box-border utility keeps borders and padding inside a declared width. Use it where a local styling reset changes sizing conventions.
Heading utilities control the visual scale independently of the semantic heading level. Choose the HTML level from the page outline.
A zoom frame pairs overflow control with a scale utility on the image. The frame stays in the grid while its contents magnify.
A video aspect utility reserves the player footprint before playback controls initialize. The width of the enclosing column drives the final height.
An empty-state variant keeps the visual rule next to the component markup. Confirm the element truly has no children before relying on the variant.
A polygon expressed as an arbitrary utility is a compact way to clip a decorative token. The outer grid still sizes the original rectangular box.
Radius utilities work best when nested surfaces share a deliberate relationship. A thick border can make equal inner and outer radii look mismatched.
Intrinsic-width utilities allow a chip to follow its label. Long labels still need a wrapping or overflow policy.
Viewport-pinned labels need deliberate offsets and a stacking level. Mobile browser controls can change how much space appears around a fixed label.
A cursor utility communicates an affordance while the pointer is over a handle. The clickable or draggable area should match that visual promise.
List-style utilities can restore markers after a reset. Combine them with sufficient padding so the markers remain inside the content area.
Grid alignment utilities can move the whole set of tracks or align individual cells. Inspect the container before changing item-level alignment.
A placeholder-shown variant represents a specific input state. It depends on placeholder behaviour and does not replace an accessible field label.
Clipping overflow differs from offering a scrolling viewport. The correct utility depends on whether the hidden material should remain reachable.
A caret utility changes the insertion indicator independently of text colour. Match its contrast to the input surface in both themes.
Combining full width with a maximum creates a panel that scales to its parent. Automatic margins can centre it after it reaches the cap.
A square utility reserves stable thumbnail geometry. Pair it with an object-fit decision that preserves the part of the source image you need.
A minimum-height utility sets a floor for a section with little content. Unlike a fixed height it leaves room for a longer translation.
Ruby markup carries the pronunciation relationship while utility classes adjust its typography. Annotation size should remain legible on small screens.