CSS Properties
250+ CSS property mappings with unit conversion, shorthands, and special handlers.
Unistyle maps theme properties to CSS through a descriptor-based system. Each CSS property has a descriptor that defines how to process the value.
The property map (propertyMap.ts) has 257 descriptors: 191 simple, 47 convert, 6 convert_fallback, 6 edge, 1 border_radius and 6 special. Together they emit about 250 distinct CSS properties from roughly 300 theme keys, counting every edge/corner key such as marginX or borderRadiusTopLeft.
In development, a theme key that no descriptor reads logs a one-time warning (unknown theme key "paddng") instead of silently rendering nothing.
Descriptor Types
simple — Pass-Through
Values used directly as CSS. No unit conversion.
{ display: 'flex', position: 'relative', color: 'red', fontFamily: 'sans-serif' }
// → display: flex; position: relative; color: red; font-family: sans-serif;Properties: display, position, boxSizing, float, flexDirection, flexWrap, alignItems, justifyContent, color, fontFamily, fontWeight, fontStyle, textAlign, textDecoration, textTransform, whiteSpace, overflow, overflowX, overflowY, visibility, cursor, pointerEvents, userSelect, objectFit, objectPosition, listStyleType, listStylePosition, backgroundAttachment, backgroundClip, backgroundOrigin, backgroundPosition, backgroundRepeat, backgroundSize, borderCollapse, tableLayout, verticalAlign, resize, wordBreak, wordWrap, textOverflow, appearance, touchAction, willChange, and many more.
convert — Number to rem
Numbers are converted to rem using rootSize. String values pass through unchanged.
{ fontSize: 16, gap: 24 }
// With rootSize=16:
// → font-size: 1rem; gap: 1.5rem;
{ fontSize: '2em', gap: 'auto' }
// → font-size: 2em; gap: auto;Properties (47): length-valued properties such as fontSize, letterSpacing, wordSpacing, textIndent, gap, rowGap, columnGap, flexBasis, gridAutoRows, gridAutoColumns, the logical margin/padding/inset properties, inlineSize / blockSize and their min/max variants, outlineWidth, outlineOffset, scrollMargin, scrollPadding, borderSpacing, perspective, columnWidth and more. See the C rows in the reference below.
Unitless properties are
simple:lineHeight,flexGrow,flexShrink,order,zIndex,opacity,gridColumnStart/gridRowStart,fontWeight,columnCount. Numbers pass through unchanged, solineHeight: 1.5becomesline-height: 1.5(a multiplier, not1.5rem).
convert_fallback — Fallback Chain + Conversion
Picks the first non-null value from a fallback chain, then converts:
| CSS Property | Fallback Chain |
|---|---|
width | width → size |
height | height → size |
min-width | minWidth → minSize |
min-height | minHeight → minSize |
max-width | maxWidth → maxSize |
max-height | maxHeight → maxSize |
{ size: 200, minSize: 100 }
// → width: 12.5rem; height: 12.5rem; min-width: 6.25rem; min-height: 6.25rem;
{ width: 300, height: 200 } // width/height override size
// → width: 18.75rem; height: 12.5rem;edge — Spacing Shorthands
Handles margin, padding, inset, and border properties with full/x/y/side expansion.
Input Keys
| Key | Sides Affected |
|---|---|
margin | All four sides |
marginX | Left + Right |
marginY | Top + Bottom |
marginTop | Top only |
marginRight | Right only |
marginBottom | Bottom only |
marginLeft | Left only |
Same pattern for padding, inset, borderWidth, borderStyle, borderColor.
Priority Resolution
- Start with
fullvalue for all sides xoverrides left and rightyoverrides top and bottom- Individual sides override everything
{ padding: 16, paddingX: 24, paddingTop: 32 }
// → padding: 2rem 1.5rem 1rem 1.5rem;
// (top: 32→2rem, right: 24→1.5rem, bottom: 16→1rem, left: 24→1.5rem)Shorthand Optimization
Output is optimized to the shortest valid CSS shorthand:
| Pattern | CSS Output |
|---|---|
| All sides equal | padding: 1rem; |
| Top=Bottom, Left=Right | padding: 1rem 1.5rem; |
| Top, Left=Right, Bottom | padding: 1rem 1.5rem 2rem; |
| All different | padding: 1rem 1.5rem 2rem 0.5rem; |
| Some sides undefined | Individual properties |
Logical Properties
CSS Logical Properties are also supported:
{ marginInline: 16, paddingBlock: 8 }
// → margin-inline: 1rem; padding-block: 0.5rem;
{ marginInlineStart: 16, paddingBlockEnd: 8 }
// → margin-inline-start: 1rem; padding-block-end: 0.5rem;border_radius — Corner Shorthands
| Key | Corners Affected |
|---|---|
borderRadius | All four corners |
borderRadiusTop | Top-left + Top-right |
borderRadiusBottom | Bottom-left + Bottom-right |
borderRadiusLeft | Top-left + Bottom-left |
borderRadiusRight | Top-right + Bottom-right |
borderRadiusTopLeft | Top-left only |
borderRadiusTopRight | Top-right only |
borderRadiusBottomLeft | Bottom-left only |
borderRadiusBottomRight | Bottom-right only |
{ borderRadius: 8 }
// → border-radius: 0.5rem;
{ borderRadius: 8, borderRadiusTopLeft: 16, borderRadiusBottomRight: 0 }
// → border-radius: 1rem 0.5rem 0rem 0.5rem;special — Custom Handlers
| Key | Output |
|---|---|
fullScreen | position: fixed; top: 0; left: 0; right: 0; bottom: 0; |
backgroundImage | background-image: url(<value>); |
animation | Combines keyframe + animation props |
hideEmpty | &:empty { display: none; } |
clearFix | &::after { clear: both; content: ''; display: table; } |
extendCss | Custom CSS (function or string) |
{ fullScreen: true }
// → position: fixed; top: 0; left: 0; right: 0; bottom: 0;
{ hideEmpty: true }
// → &:empty { display: none; }
{ extendCss: (css) => css`&:hover { opacity: 0.8; }` }
// → &:hover { opacity: 0.8; }Unit Conversion Rules
Understanding when values are converted:
| Input | Output (Web) | Output (Native) |
|---|---|---|
16 (number) | 1rem (16/rootSize) | 16px |
0 (zero) | 0 (unitless) | 0 (unitless) |
'16px' (px string) | 1rem (px → rem) | '16px' (unchanged) |
'2em', '50%' (other units) | unchanged | unchanged |
'auto' (keyword) | 'auto' (unchanged) | 'auto' (unchanged) |
null / undefined | Skipped | Skipped |
Only the convert, convert_fallback, edge and border_radius descriptor types perform unit conversion. simple descriptors pass values through unchanged. borderWidth* edge keys convert to px instead of rem; borderStyle* and borderColor* are not converted.
Complete Property Reference
Every property supported by unistyle, organized by category. The Type column indicates the descriptor type: S = simple (pass-through), C = convert (number→rem), CF = convert_fallback, E = edge shorthand, BR = border-radius shorthand, SP = special handler.
Position & Layout
| Prop | CSS Property | Type |
|---|---|---|
all | all | S |
display | display | S |
position | position | S |
boxSizing | box-sizing | S |
float | float | S |
zIndex | z-index | S |
overflow | overflow | S |
overflowX | overflow-x | S |
overflowY | overflow-y | S |
overflowWrap | overflow-wrap | S |
visibility | visibility | S |
contain | contain | S |
containerType | container-type | S |
containerName | container-name | S |
container | container | S |
contentVisibility | content-visibility | S |
Inset (Edge Shorthand)
| Prop | Sides Affected | Type |
|---|---|---|
inset | All four sides | E |
insetX | Left + Right | E |
insetY | Top + Bottom | E |
top | Top only | E |
right | Right only | E |
bottom | Bottom only | E |
left | Left only | E |
Logical inset: insetInline, insetInlineStart, insetInlineEnd, insetBlock, insetBlockStart, insetBlockEnd — all type C.
Sizing
| Prop | CSS Property | Type | Fallback |
|---|---|---|---|
width | width | CF | width → size |
height | height | CF | height → size |
minWidth | min-width | CF | minWidth → minSize |
minHeight | min-height | CF | minHeight → minSize |
maxWidth | max-width | CF | maxWidth → maxSize |
maxHeight | max-height | CF | maxHeight → maxSize |
aspectRatio | aspect-ratio | S | — |
gap | gap | C | — |
inlineSize | inline-size | C | — |
blockSize | block-size | C | — |
minInlineSize | min-inline-size | C | — |
minBlockSize | min-block-size | C | — |
maxInlineSize | max-inline-size | C | — |
maxBlockSize | max-block-size | C | — |
Shorthand props (not real CSS, resolved internally): size (sets both width+height), minSize (sets both min-width+min-height), maxSize (sets both max-width+max-height).
Spacing (Edge Shorthands)
Margin: margin, marginX, marginY, marginTop, marginRight, marginBottom, marginLeft — all type E with rem conversion.
Padding: padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft — all type E with rem conversion.
Logical margin: marginInline, marginInlineStart, marginInlineEnd, marginBlock, marginBlockStart, marginBlockEnd — all type C.
Logical padding: paddingInline, paddingInlineStart, paddingInlineEnd, paddingBlock, paddingBlockStart, paddingBlockEnd — all type C.
Flexbox
| Prop | CSS Property | Type |
|---|---|---|
flex | flex | S |
flexBasis | flex-basis | C |
flexDirection | flex-direction | S |
flexFlow | flex-flow | S |
flexGrow | flex-grow | S |
flexShrink | flex-shrink | S |
flexWrap | flex-wrap | S |
alignItems | align-items | S |
alignContent | align-content | S |
alignSelf | align-self | S |
justifyContent | justify-content | S |
justifyItems | justify-items | S |
justifySelf | justify-self | S |
placeContent | place-content | S |
placeItems | place-items | S |
placeSelf | place-self | S |
rowGap | row-gap | C |
columnGap | column-gap | C |
order | order | S |
Grid
| Prop | CSS Property | Type |
|---|---|---|
grid | grid | S |
gridArea | grid-area | S |
gridTemplateColumns | grid-template-columns | S |
gridTemplateRows | grid-template-rows | S |
gridTemplateAreas | grid-template-areas | S |
gridAutoColumns | grid-auto-columns | C |
gridAutoRows | grid-auto-rows | C |
gridAutoFlow | grid-auto-flow | S |
gridColumn | grid-column | S |
gridColumnStart | grid-column-start | S |
gridColumnEnd | grid-column-end | S |
gridColumnGap | grid-column-gap | C |
gridRow | grid-row | S |
gridRowStart | grid-row-start | S |
gridRowEnd | grid-row-end | S |
gridRowGap | grid-row-gap | C |
gridGap | grid-gap | C |
gridTemplate | grid-template | S |
Typography
| Prop | CSS Property | Type |
|---|---|---|
font | font | S |
fontFamily | font-family | S |
fontSize | font-size | C |
fontSizeAdjust | font-size-adjust | S |
fontStretch | font-stretch | S |
fontStyle | font-style | S |
fontVariant | font-variant | S |
fontWeight | font-weight | S |
fontKerning | font-kerning | S |
fontFeatureSettings | font-feature-settings | S |
fontVariationSettings | font-variation-settings | S |
fontOpticalSizing | font-optical-sizing | S |
lineHeight | line-height | S |
letterSpacing | letter-spacing | C |
wordSpacing | word-spacing | C |
textAlign | text-align | S |
textAlignLast | text-align-last | S |
textDecoration | text-decoration | S |
textDecorationColor | text-decoration-color | S |
textDecorationLine | text-decoration-line | S |
textDecorationStyle | text-decoration-style | S |
textDecorationThickness | text-decoration-thickness | C |
textUnderlineOffset | text-underline-offset | C |
textEmphasis | text-emphasis | S |
textEmphasisColor | text-emphasis-color | S |
textEmphasisStyle | text-emphasis-style | S |
textTransform | text-transform | S |
textShadow | text-shadow | S |
textOverflow | text-overflow | S |
textIndent | text-indent | C |
textJustify | text-justify | S |
textWrap | text-wrap | S |
textRendering | text-rendering | S |
whiteSpace | white-space | S |
wordBreak | word-break | S |
wordWrap | word-wrap | S |
writingMode | writing-mode | S |
direction | direction | S |
hyphens | hyphens | S |
Colors & Background
| Prop | CSS Property | Type |
|---|---|---|
color | color | S |
opacity | opacity | S |
background | background | S |
backgroundColor | background-color | S |
backgroundImage | background-image | SP (wraps with url()) |
backgroundAttachment | background-attachment | S |
backgroundClip | background-clip | S |
backgroundOrigin | background-origin | S |
backgroundPosition | background-position | S |
backgroundRepeat | background-repeat | S |
backgroundSize | background-size | S |
Borders
Shorthand border: border, borderTop, borderBottom, borderLeft, borderRight — all type S.
Border width (edge shorthand): borderWidth, borderWidthX, borderWidthY, borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft — type E with px unit.
Border style (edge shorthand): borderStyle, borderStyleX, borderStyleY, borderStyleTop, borderStyleRight, borderStyleBottom, borderStyleLeft — type E (no unit).
Border color (edge shorthand): borderColor, borderColorX, borderColorY, borderColorTop, borderColorRight, borderColorBottom, borderColorLeft — type E (no unit).
Border radius (corner shorthand): borderRadius, borderRadiusTop, borderRadiusBottom, borderRadiusLeft, borderRadiusRight, borderRadiusTopLeft, borderRadiusTopRight, borderRadiusBottomLeft, borderRadiusBottomRight — type BR with rem conversion.
Border other: borderSpacing (C), borderCollapse (S), borderImage (S), borderImageOutset (S), borderImageRepeat (S), borderImageSlice (S), borderImageSource (S), borderImageWidth (S).
Logical borders: borderInline, borderBlock, borderInlineStart, borderInlineEnd, borderBlockStart, borderBlockEnd — all type S.
Visual Effects
| Prop | CSS Property | Type |
|---|---|---|
boxShadow | box-shadow | S |
filter | filter | S |
backdropFilter | backdrop-filter | S |
mixBlendMode | mix-blend-mode | S |
backgroundBlendMode | background-blend-mode | S |
isolation | isolation | S |
outline | outline | S |
outlineColor | outline-color | S |
outlineOffset | outline-offset | C |
outlineStyle | outline-style | S |
outlineWidth | outline-width | C |
backfaceVisibility | backface-visibility | S |
Animations & Transforms
| Prop | CSS Property | Type |
|---|---|---|
animation | — | SP (combines keyframe + animation) |
animationName | animation-name | S |
animationDuration | animation-duration | S |
animationTimingFunction | animation-timing-function | S |
animationDelay | animation-delay | S |
animationIterationCount | animation-iteration-count | S |
animationDirection | animation-direction | S |
animationFillMode | animation-fill-mode | S |
animationPlayState | animation-play-state | S |
transition | transition | S |
transitionDelay | transition-delay | S |
transitionDuration | transition-duration | S |
transitionProperty | transition-property | S |
transitionTimingFunction | transition-timing-function | S |
transform | transform | S |
transformOrigin | transform-origin | S |
transformStyle | transform-style | S |
translate | translate | S |
rotate | rotate | S |
scale | scale | S |
willChange | will-change | S |
Scroll
| Prop | CSS Property | Type |
|---|---|---|
scrollBehavior | scroll-behavior | S |
scrollSnapType | scroll-snap-type | S |
scrollSnapAlign | scroll-snap-align | S |
scrollSnapStop | scroll-snap-stop | S |
scrollMargin | scroll-margin | C |
scrollPadding | scroll-padding | C |
overscrollBehavior | overscroll-behavior | S |
overscrollBehaviorX | overscroll-behavior-x | S |
overscrollBehaviorY | overscroll-behavior-y | S |
Interaction
| Prop | CSS Property | Type |
|---|---|---|
cursor | cursor | S |
pointerEvents | pointer-events | S |
userSelect | user-select | S |
touchAction | touch-action | S |
scrollbarWidth | scrollbar-width | S |
scrollbarColor | scrollbar-color | S |
scrollbarGutter | scrollbar-gutter | S |
caretColor | caret-color | S |
accentColor | accent-color | S |
colorScheme | color-scheme | S |
appearance | appearance | S |
imageRendering | image-rendering | S |
Lists
| Prop | CSS Property | Type |
|---|---|---|
listStyle | list-style | S |
listStyleImage | list-style-image | S |
listStylePosition | list-style-position | S |
listStyleType | list-style-type | S |
Masks
| Prop | CSS Property | Type |
|---|---|---|
maskImage | mask-image | S |
maskSize | mask-size | S |
maskPosition | mask-position | S |
maskRepeat | mask-repeat | S |
Shapes
| Prop | CSS Property | Type |
|---|---|---|
shapeOutside | shape-outside | S |
shapeMargin | shape-margin | C |
shapeImageThreshold | shape-image-threshold | S |
Columns
| Prop | CSS Property | Type |
|---|---|---|
columnCount | column-count | S |
columnWidth | column-width | C |
columnRule | column-rule | S |
columns | columns | S |
Table & Misc
| Prop | CSS Property | Type |
|---|---|---|
tableLayout | table-layout | S |
captionSide | caption-side | S |
emptyCells | empty-cells | S |
content | content | S |
counterIncrement | counter-increment | S |
counterReset | counter-reset | S |
clear | clear | S |
clip | clip | S |
clipPath | clip-path | S |
perspective | perspective | C |
perspectiveOrigin | perspective-origin | S |
quotes | quotes | S |
tabSize | tab-size | S |
objectFit | object-fit | S |
objectPosition | object-position | S |
resize | resize | S |
verticalAlign | vertical-align | S |
Fragmentation (Print)
| Prop | CSS Property | Type |
|---|---|---|
breakBefore | break-before | S |
breakAfter | break-after | S |
breakInside | break-inside | S |
orphans | orphans | S |
widows | widows | S |
printColorAdjust | print-color-adjust | S |
API Reference
ExtendCss
Prop
Type
Styles
Prop
Type
Last updated on