Stylecheat

Modifiers are plain HTML attributes. We call them modifiers because that is exactly what they do — modify the default appearance or state of an element.

Under the hood they are CSS attribute selectors: [sm], [g-4], [text-red]. Drop an attribute on any element and the style applies immediately. Prefer classes? Every modifier is also available as a class — .sm, .g-4, .text-red.

Modifiers compose without conflict. Each one owns a single property, so stacking sm g-2 text-red on the same element is perfectly safe — order never matters and nothing overrides anything else.

Scale

The three scale modifiers set --unit and --unit-size together. sm is two thirds of the default and lg four thirds. Everything built with calc(var(--unit) * N) scales in step — spacing, font size, line height, border-radius, gap.

Buttons, text inputs and dropdowns — and a <label> wrapping one — keep their text size under sm. Only --unit changes, so they get shorter while the text stays readable.

Modifier--unit--unit-size
sm2.67px (4px × ⅔)10.67px (16px × ⅔)
md4px16px
lg5.33px (4px × 4⁄3)21.33px (16px × 4⁄3)

Display

Control the display type or flex ratio of any element.

ModifierEffect
hidedisplay: none
flexdisplay: flex
blockdisplay: block
inline-blockdisplay: inline-block
f-0..8flex: 0..8
justify-betweenjustify-content: space-between
wrapflex-wrap: wrap
overflow-hiddenoverflow: hidden
overflow-autooverflow: auto

Surface

Strip an element's surface or make it react to the pointer. hover lays a faint foreground tint over whatever background the element already has. The typed hover="…" form swaps in a background color of your own instead.

ModifierEffectPreview
bg-transparentNo background, border or own text colorAa
bg-backgroundPage background colorAa
bg-cardCard surface colorAa
roundedborder-radius: var(--radius)Aa
hoverPointer cursor and a hover tintAa
hover="…"Hover background color (experimental)Aa

Sizing

Set width or height to full, auto or a size in units, and cap width with max-w-*. Sizes run 0–8, then 10, 12, 16, 18, 20, 24, 32, 36, 40, 48, 60, 64, 72, 96, 128 and 160. The typed w and h attributes take any value — experimental, Chrome 133+ only for now.

ModifierEffect
w-fullwidth: 100%
h-fullheight: 100%
mw-fullmin-width: 100%
mh-fullmin-height: 100%
w-autowidth: auto
h-autoheight: auto
w-*width: N × --unit
h-*height: N × --unit
max-w-fullmax-width: 100%
max-w-*max-width: N × --unit
w="N"width: N × --unit (experimental)
h="N"height: N × --unit (experimental)

Gap

Gap between flex or grid children. Scales with --unit.

ModifierProperty
g-0..8, 10, 12, 16gap

Spacing

Margin and padding utilities follow a consistent naming pattern. All values scale with --unit, so they respond to sm, md, and lg automatically.

PrefixProperty
m-0..8margin (all sides)
mt-0..8margin-top
mb-0..8margin-bottom
ml-0..8margin-left
mr-0..8margin-right
mx-0..8margin-inline (left + right)
my-0..8margin-block (top + bottom)
p-0..8padding (all sides)
pt-0..8padding-top
pb-0..8padding-bottom
pl-0..8padding-left
pr-0..8padding-right
px-0..8padding-inline (left + right)
py-0..8padding-block (top + bottom)
m--1..8negative margin — every margin prefix takes --1..8, e.g. mx--4

Position

Position and inset utilities for positioned elements. Inset values scale with --unit.

ModifierProperty
position="…"static / relative / absolute / fixed / sticky
contain="…"none / strict / content / size / inline-size / layout / style / paint
t-0..8top
r-0..8right
b-0..8bottom
l-0..8left
order-firstorder: -1

Color

Text and background color utilities built on CSS custom properties. Background tints use 20% opacity so they work on any surface without clashing.

ModifierPreview
text-blueAa
text-purpleAa
text-greenAa
text-orangeAa
text-cyanAa
text-redAa
text-yellowAa
text-slateAa
text-primaryAa
text-mutedAa
ModifierPreview
bg-blue
bg-purple
bg-green
bg-orange
bg-cyan
bg-red
bg-yellow
bg-slate

Responsive

Prefix a scale, display, sizing, gap or spacing modifier with sm:, md:, or lg: to apply it only at a specific breakpoint — p-8 sm:p-4, w-96 sm:w-full. Carousels switch axis on phones with sm:x, sm:y and sm:z.

PrefixBreakpointAvailable modifiers
sm:≤ 768pxsm, md, lg, hide, flex, block, vertical, order-first, f-*, g-*, w-*, h-*, max-w-*, m*-*, p*-*
md:769px – 1024pxsm, md, lg, hide, flex, block, vertical, order-first, f-*, g-*, w-*, h-*, max-w-*, m*-*, p*-*
lg:> 1024pxsm, md, lg, hide, flex, block, vertical, order-first, f-*, g-*, w-*, h-*, max-w-*, m*-*, p*-*

Transform

Rotate any element by a number of degrees. Built on the rotate property, so it composes with transform-based animations instead of overriding them. Typed attribute — Chrome 133+ for now.

ModifierEffect
rotate="N"rotate: N degrees (experimental)

Animations

A small set of functional animations. Each one has a clear semantic role — loading, attention, error, or content placeholder. Drop the modifier on any element; pair with <icon> for inline indicators.

ModifierUsePreview
animate-spinLoading, processing
animate-pulseAlive, loading dot
animate-pingNotification ring
animate-bounceBouncing attention
animate-shakeError feedback
animate-shimmerSkeleton placeholder

Transitions

Two-state transitions driven by the [toggled] attribute. Add the modifier to arm the transition (in-variants start hidden, out-variants and flips start in their resting state); add [toggled] to play to the other state, remove it to reverse. animate-y also flips on its own when its parent's next sibling carries [open], which is how an accordion chevron turns.

ModifierUsePreview
animate-fade-inFade content in
animate-fade-outFade content out
animate-slide-in-leftSlide in from left
animate-slide-in-rightSlide in from right
animate-slide-in-upSlide in from above
animate-slide-in-downSlide in from below
animate-bounce-inBounce in
animate-bounce-outBounce out
animate-xFlip horizontally (rotateY 180°)
animate-yFlip vertically (rotateX 180°)

Modifiers


Stylecheat Introduction Context CardCircleCrowGridSidebarStackSticky AccordionBadgeBreadcrumbCarouselCodeHrIconLinkTableTabsTooltipTypography ButtonSwitchCheckboxRadioRangeProgressSelectTextinputTextarea Modifiers LoginCarouselElementsContent flowIcons Download v1.0.0
Stylecheat