Tasty logoTasty
Playground

Style Properties

All standard CSS properties are supported in Tasty and benefit from its syntax sugar: design tokens ($name, #name), custom units (2x, 1r, 1bw), color opacity (#purple.5), auto-calc ((100% - 2x)), and custom functions. Values are parsed through the Tasty engine automatically.

The properties documented below have custom handlers with enhanced syntax. They should be preferred over their raw CSS equivalents because they:

Other CSS properties (e.g. opacity, transform, cursor, position, zIndex) are passed through with standard Tasty value parsing but no special handler logic.


Use these instead of their raw CSS counterparts:

UseInstead of
fillbackgroundColor, background
imagebackgroundImage
padding (with direction modifiers)paddingTop, paddingRight, paddingBottom, paddingLeft
margin (with direction modifiers)marginTop, marginRight, marginBottom, marginLeft
width (with min/max modifiers)minWidth, maxWidth
height (with min/max modifiers)minHeight, maxHeight
borderborderColor, borderWidth, borderStyle
radiusborderRadius
flowflexDirection, gridAutoFlow
presetfontSize, lineHeight, letterSpacing, fontWeight, fontStyle, textTransform
fontfontFamily
inset (with direction modifiers)top, right, bottom, left
scrollbarRaw scrollbar CSS properties

Layout

display

Standard CSS display values. Handled together with hide, textOverflow, overflow, and whiteSpace for priority resolution.

PropValuesNotes
displayAny CSS display valueOverridden by hide or multi-line textOverflow
hidetrue / falseShortcut for display: none. Highest priority
overflowAny CSS overflow valueOverridden when textOverflow sets hidden
whiteSpaceAny CSS white-space valueOverridden when textOverflow sets nowrap or initial

textOverflow

Text truncation with optional multi-line clamping.

Syntax: [ellipsis|clip] or [ellipsis|clip] / [lines]

ValueEffect
"ellipsis"Single-line truncation with ellipsis, sets overflow: hidden and white-space: nowrap
"ellipsis / 3"Multi-line clamp (3 lines) with ellipsis, sets overflow: hidden and white-space: initial
"clip"Single-line truncation without ellipsis, sets overflow: hidden and white-space: nowrap
"clip / 2"Multi-line clip (2 lines), sets overflow: hidden and white-space: initial
true or "initial"Reset text-overflow to initial

Explicit whiteSpace overrides the default white-space set by textOverflow.

flow

Unified direction control for flex and grid layouts.

Syntax: [direction] [wrap|dense]

LayoutCSS output
Flexflex-flow (direction + wrap)
Gridgrid-auto-flow (direction + density)
BlockNo CSS output (used by gap for direction)
flow="row wrap"       // flex: row wrap
flow="column dense"   // grid: column dense
flow="column"         // flex: column; or grid: column

gap

Spacing between child elements. Adapts to layout type.

Syntax: [row-gap] or [row-gap column-gap]

ValueEffect
"2x"Gap of 2x
"1x 2x"Row gap 1x, column gap 2x
trueDefault gap (1x)
NumberConverted to px

For flex/grid layouts, outputs native gap. For block layouts, emulates gap using margin on children based on flow direction.

padding

Element padding with directional modifiers and multi-group support. Use comma-separated groups to set a base value and then override specific directions.

Syntax: [value] | [top right] | [top right bottom left] | [value directions...] — comma-separated for multiple groups

Direction modifiers: top, right, bottom, left

ValueEffect
"2x"All sides 2x
"2x 1x"Top/bottom 2x, left/right 1x
"2x top"Top 2x, right/bottom/left 0
"1x left right"Left and right 1x, top/bottom 0
"1x, 2x top"All sides 1x, then top overridden to 2x
"1x, 2x top bottom"Left/right 1x, top/bottom 2x
trueAll sides 1x
NumberConverted to px

Later comma-separated groups override earlier groups for conflicting directions.

Individual props paddingTop, paddingRight, paddingBottom, paddingLeft, paddingBlock, paddingInline are supported but padding with modifiers is recommended.

Priority: padding < paddingBlock/paddingInline < paddingTop/paddingRight/paddingBottom/paddingLeft

margin

Element margin. Same syntax, modifiers, and multi-group support as padding.

Syntax: [value] | [top right] | [top right bottom left] | [value directions...] — comma-separated for multiple groups

Direction modifiers: top, right, bottom, left

ValueEffect
"2x"All sides 2x
"2x 1x"Top/bottom 2x, left/right 1x
"2x top"Top 2x, right/bottom/left 0
"auto left right, 1x top bottom"Left/right auto, top/bottom 1x
trueAll sides 1x
NumberConverted to px

Later comma-separated groups override earlier groups for conflicting directions.

Individual props marginTop, marginRight, marginBottom, marginLeft, marginBlock, marginInline are supported but margin with modifiers is recommended.

Priority: margin < marginBlock/marginInline < marginTop/marginRight/marginBottom/marginLeft

width

Element width with min/max control. One, two, or three values set min-width, width, and max-width together.

Positional syntax:

Valuemin-widthwidthmax-width
"10x"initial10xinitial
"1x 10x"1xauto10x
"1x 5x 10x"1x5x10x
"0 100% 800px"0100%800px
"initial 100% 1400px"initial100%1400px

Modifier syntax:

Valuemin-widthwidthmax-width
"min 2x"2xautoinitial
"max 100%"initialauto100%
"fixed 200px"200px200px200px

Keywords: stretch, max-content, min-content, fit-content

ValueEffect
"stretch"Fill available space (cross-browser)
trueReset to auto / initial / initial
NumberConverted to px

Separate minWidth and maxWidth props are supported and override values from the width syntax.

height

Element height. Same syntax, modifiers, and positional patterns as width.

Separate minHeight and maxHeight props are supported and override values from the height syntax.

inset

Positioning offsets with directional modifiers and multi-group support. Same directional syntax as padding.

Syntax: [value] | [top right] | [top right bottom left] | [value directions...] — comma-separated for multiple groups

Direction modifiers: top, right, bottom, left

ValueEffect
"0"All sides 0
"2x top"Top 2x, right/bottom/left auto
"1x left right"Left and right 1x, top/bottom auto
"0, 2x top"All sides 0, then top overridden to 2x
trueAll sides 0

Later comma-separated groups override earlier groups for conflicting directions.

Individual props top, right, bottom, left, insetBlock, insetInline are supported. When only individual direction props are used (without inset), individual CSS properties are output for correct cascade behavior with state overrides.

Priority: inset < insetBlock/insetInline < top/right/bottom/left


Color & Background

fill

Background color with design token support. Preferred over backgroundColor and background.

Syntax: [color] or [base-color] [overlay-color]

ValueEffect
"#purple"Token-based background color
"#purple.10"Token color at 10% opacity
"#surface #primary.10"Background #surface with #primary.10 overlay (two colors enable smooth transitions between both)
"rgb(255 128 0)"CSS color value
trueDefault fill color

When two colors are provided, the first sets the background color and the second is applied as an overlay gradient layer. This enables independent CSS transitions on each color. The overlay is only applied when no explicit image or backgroundImage is set.

Related deprecated props: backgroundColor (use fill), background (overrides all background props when set — avoid).

image

Background image. Preferred over backgroundImage.

Syntax: Any CSS background-image value (parsed for token support).

image="url(/path/to/image.png)"
image="linear-gradient(to right, #purple, #danger)"

Other background props (backgroundPosition, backgroundSize, backgroundRepeat, backgroundAttachment, backgroundOrigin, backgroundClip) are supported as separate props with standard Tasty value parsing.

color

Text color with design token support.

Syntax: Color token, CSS color, true, or fallback syntax

ValueEffect
"#purple"Token-based text color
"#purple.5"Token at 50% opacity
"#current"Current inherited color
"#current.5"Current inherited color at 50% opacity
"(#primary, #secondary)"Fallback: use #primary, fall back to #secondary
truecurrentColor

When set to a named color token, also sets $current-color and $current-color-{colorSpace} custom properties for downstream use (suffix depends on the configured colorSpace, default oklch).

svgFill

SVG fill color. Same color token syntax as fill and color. Outputs the native CSS fill property.

svgFill="#purple.10"
svgFill="currentColor"

Border & Outline

border

Border shorthand with directional and multi-group support. Use comma-separated groups to set different values per direction — this is the recommended approach for directional borders.

Syntax: [width] [style] [color] [directions...] — comma-separated for multiple groups

Defaults: width = 1bw, style = solid, color = #border

Styles: none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset

Direction modifiers: top, right, bottom, left

ValueEffect
trueDefault border (1bw solid #border) on all sides
"2bw dashed #purple"All sides: 2bw dashed purple
"2bw top"Top only: 2bw solid #border, others: 0
"dotted #danger left right"Left/right: 1bw dotted #danger, others: 0
"1bw #red, 2bw #blue top"All sides: 1bw solid #red, top overridden to 2bw solid #blue
"1bw, dashed top bottom, #purple left right"Base: 1bw solid #border, top/bottom: 1bw dashed #border, left/right: 1bw solid #purple

Later comma-separated groups override earlier groups for conflicting directions.

radius

Border radius with shape presets and directional modifiers.

Syntax: [value] [modifiers...] | [shape] | true

Shapes:

ShapeEffect
"round"Fully rounded (9999rem)
"ellipse"Circular (50%)
"leaf"Asymmetric: sharp, round, sharp, round
"backleaf"Asymmetric: round, sharp, round, sharp
"inherit"Inherit border-radius from parent

Direction modifiers: top, right, bottom, left — rounds only the specified corners.

ValueEffect
"2r"All corners 2r
trueAll corners 1r
"round"All corners 9999rem (pill shape)
"1r top"Top-left and top-right 1r, bottom-left and bottom-right 0
"leaf"Alternating sharp/round corners (top-left 0, top-right 1r, bottom-right 0, bottom-left 1r)
"backleaf"Inverse leaf (top-left 1r, top-right 0, bottom-right 1r, bottom-left 0)
"inherit"All corners inherit from parent (border-radius: inherit)
"inherit right"Right corners inherit from parent (uses longhand properties)

outline

Outline with inline offset support.

Syntax: [width] [style] [color] / [offset]

Defaults: width = 1ow, style = solid, color = #outline

Styles: Same as border (none, dotted, dashed, solid, etc.)

ValueEffect
trueDefault outline (1ow solid #outline)
"2ow dashed #purple"2ow dashed #purple outline
"2ow #danger / 1x"2ow solid #danger outline with 1x offset
"2ow / 1x"2ow solid #outline with 1x offset
0No outline

The / separator separates outline from offset. A separate outlineOffset prop is also supported but the slash syntax takes precedence.

shadow

Box shadow. Supports multiple shadows comma-separated.

Syntax: [inset] [x] [y] [blur] [spread] [color]

ValueEffect
trueDefault shadow (uses var(--shadow) — define a $shadow token in your design system)
"1x .5x .5x #dark.50"Custom shadow with Tasty units/colors
"0 1x 2x #dark.20"Standard shadow
"inset 0 1x 2x #dark.10"Inset shadow

Multiple shadows: shadow="1x 1x 2x #dark.20, inset 0 0 4x #dark.10"


Typography

preset

Typography preset that sets font-size, line-height, letter-spacing, font-weight, font-style, and text-transform from named design tokens.

Syntax: name, name / modifier, or modifier (shorthand)

Preset names are project-specific (e.g. h1h6, t1t4, p1p4). Register them for autocomplete by augmenting TastyPresetNames.

Use / to separate the preset name from a modifier. When a modifier is used alone (without a name), the preset name defaults to inherit.

Modifiers:

ModifierEffect
strong (or bold)Sets font-weight to bold (from $bold-font-weight token)
italicSets font-style: italic
iconSets font-size and line-height to icon size
tightSets line-height equal to font-size
preset="h1"              // heading 1
preset="h2 / strong"     // bold heading 2
preset="t3 / italic"     // italic text 3
preset="t2 / tight"      // text 2 with tight line-height
preset="bold"             // inherit preset with bold (shorthand for "inherit / bold")

Individual typography props (fontSize, lineHeight, letterSpacing, fontWeight, fontStyle, textTransform) can be used alongside preset to override specific values, but using preset alone is recommended.

font

Font family with design-system fallback. Preferred over fontFamily.

ValueEffect
"monospace"Monospace font stack (from $monospace-font token)
trueDefault system font (from $font token)
"CustomFont"Custom font with system font fallback

fontFamily is supported as a direct pass-through without fallback logic.


Alignment

Use the individual CSS properties (alignItems, alignContent, justifyItems, justifyContent, placeItems, placeContent) for precise control. The shorthands below set both the -items and -content variants to the same value, which is convenient but less flexible.

align

Shorthand that sets both align-items and align-content to the same value.

align="center"
align="flex-start"
align="space-between"

justify

Shorthand that sets both justify-items and justify-content to the same value.

justify="center"
justify="space-between"
justify="flex-end"

place

Shorthand that sets both place-items and place-content to the same value.

place="center"
place="stretch"

Individual props placeContent and placeItems are also available for separate control.


Animation & Transition

transition

Semantic transition names that expand to groups of CSS properties.

Syntax: [name] [timing] [easing] [delay] or [name] [easing] [delay] — comma-separated for multiple transitions.

When easing is provided without a duration, the default timing variable is used automatically.

Semantic names:

NameCSS properties
fillbackground-color, background-image, --tasty-second-fill-color
colorcolor
themecolor, background-color, background-image, box-shadow, border, border-radius, outline, opacity, --tasty-second-fill-color
borderborder, border-top, border-right, border-bottom, border-left
radiusborder-radius
shadowbox-shadow
outlineoutline, outline-offset
presetfont-size, line-height, letter-spacing, font-weight, font-style
textfont-weight, text-decoration-color
fademask, mask-composite
opacityopacity
translatetransform, translate
rotatetransform, rotate
scaletransform, scale
filterfilter, backdrop-filter
image / backgroundAll background-related properties
widthwidth, min-width, max-width
heightheight, min-height, max-height
gapgap, margin
zIndexz-index
insetinset, top, right, bottom, left

Default timing: $transition (or ${name}-transition with $transition fallback per semantic name).

transition="theme 0.3s"
transition="fill 0.2s, radius 0.3s"
transition="fade 0.15s ease-in"
transition="fill ease-in"           // easing without duration (uses default timing)
transition="radius ease-in-out"     // easing keyword only
transition="$$custom-prop 0.3s"     // custom property transition

Recognized easing keywords: ease, ease-in, ease-out, ease-in-out, linear, step-start, step-end. CSS easing functions (cubic-bezier(...), steps(...), linear(...)) are also recognized.

If the name is not a semantic name, it is used as a literal CSS property name.


Scrollbar & Overflow

scrollbar

Scrollbar styling using CSS standard properties (scrollbar-width, scrollbar-color, scrollbar-gutter).

Syntax: [width] [modifiers...] [thumb-color] [track-color]

Width values (controls scrollbar-width, default is thin):

ValueEffect
thinThin scrollbar (default)
autoBrowser-default scrollbar width
noneHide scrollbar (still scrollable, no colors applied)

Modifiers (controls gutter and overflow behavior):

ModifierEffect
stableReserve space for scrollbar (scrollbar-gutter: stable)
both-edgesReserve space on both sides (scrollbar-gutter: stable both-edges)
alwaysForce scrollbars visible (overflow: scroll + scrollbar-gutter: stable)

Colors: Up to 2 color values for thumb and track (optional), applied via scrollbar-color.

Defaults: When no colors are specified, the thumb color comes from var(--scrollbar-thumb-color) and the track color from var(--scrollbar-track-color, transparent). These are not built-in — your design system should define #scrollbar-thumb and #scrollbar-track tokens (e.g. '#text.5' and '#dark-bg'). If neither token is defined, the track falls back to transparent via a CSS fallback, while the thumb has no CSS-level fallback — the browser treats the entire scrollbar-color declaration as invalid and reverts to the platform-default scrollbar appearance.

Note: none takes precedence over all other modifiers and colors. Combining none with other tokens (e.g., "none always #red") produces a warning, and only scrollbar-width: none is applied.

ValueEffect
trueThin scrollbar with default thumb/track colors
"none"Hidden scrollbar (still scrollable)
"thin #purple.40 #dark.04"Thin scrollbar with custom colors
"auto #red #blue"Browser-default width with custom colors
"always #primary.50 #white.02"Always visible with custom colors
"thin stable #red #blue"Thin, gutter reserved, custom colors

fade

Gradient-based edge fading using CSS masks. Use comma-separated groups to set different widths and colors per direction.

Syntax: [width] [directions...] [#from-color] [#to-color] — comma-separated for multiple groups

Direction modifiers: top, right, bottom, left

ValueEffect
"top"Fade top edge, default width (2x), all other edges unfaded
"2x left right"Fade left and right edges with 2x width, top/bottom unfaded
"3x 1x top bottom"Fade top with 3x width, bottom with 1x width
"2x #transparent #dark"All edges faded with 2x width, from #transparent to #dark
"top #a #b, bottom #c #d"Top fades from #a to #b, bottom fades from #c to #d

Colors are optional: first = transparent mask start, second = opaque mask end.


Grid Aliases

gridColumns

Alias for grid-template-columns.

ValueEffect
"1fr 2fr 1fr"Three columns with ratios
3 (number)Three equal minmax(1px, 1fr) columns
"repeat(auto-fit, minmax(200px, 1fr))"Responsive columns

gridRows

Alias for grid-template-rows.

ValueEffect
"auto 1fr auto"Header, content, footer
4 (number)Four equal auto rows

gridAreas

Alias for grid-template-areas. Pass-through string value.

gridTemplate

Alias for grid-template. Slash-separated rows/columns with number conversion.