Skip to Content
vitus·labs
Unistyle

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, so lineHeight: 1.5 becomes line-height: 1.5 (a multiplier, not 1.5rem).

convert_fallback — Fallback Chain + Conversion

Picks the first non-null value from a fallback chain, then converts:

CSS PropertyFallback Chain
widthwidth → size
heightheight → size
min-widthminWidth → minSize
min-heightminHeight → minSize
max-widthmaxWidth → maxSize
max-heightmaxHeight → 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

KeySides Affected
marginAll four sides
marginXLeft + Right
marginYTop + Bottom
marginTopTop only
marginRightRight only
marginBottomBottom only
marginLeftLeft only

Same pattern for padding, inset, borderWidth, borderStyle, borderColor.

Priority Resolution

  1. Start with full value for all sides
  2. x overrides left and right
  3. y overrides top and bottom
  4. 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:

PatternCSS Output
All sides equalpadding: 1rem;
Top=Bottom, Left=Rightpadding: 1rem 1.5rem;
Top, Left=Right, Bottompadding: 1rem 1.5rem 2rem;
All differentpadding: 1rem 1.5rem 2rem 0.5rem;
Some sides undefinedIndividual 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

KeyCorners Affected
borderRadiusAll four corners
borderRadiusTopTop-left + Top-right
borderRadiusBottomBottom-left + Bottom-right
borderRadiusLeftTop-left + Bottom-left
borderRadiusRightTop-right + Bottom-right
borderRadiusTopLeftTop-left only
borderRadiusTopRightTop-right only
borderRadiusBottomLeftBottom-left only
borderRadiusBottomRightBottom-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

KeyOutput
fullScreenposition: fixed; top: 0; left: 0; right: 0; bottom: 0;
backgroundImagebackground-image: url(<value>);
animationCombines keyframe + animation props
hideEmpty&:empty { display: none; }
clearFix&::after { clear: both; content: ''; display: table; }
extendCssCustom 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:

InputOutput (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)unchangedunchanged
'auto' (keyword)'auto' (unchanged)'auto' (unchanged)
null / undefinedSkippedSkipped

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

PropCSS PropertyType
allallS
displaydisplayS
positionpositionS
boxSizingbox-sizingS
floatfloatS
zIndexz-indexS
overflowoverflowS
overflowXoverflow-xS
overflowYoverflow-yS
overflowWrapoverflow-wrapS
visibilityvisibilityS
containcontainS
containerTypecontainer-typeS
containerNamecontainer-nameS
containercontainerS
contentVisibilitycontent-visibilityS

Inset (Edge Shorthand)

PropSides AffectedType
insetAll four sidesE
insetXLeft + RightE
insetYTop + BottomE
topTop onlyE
rightRight onlyE
bottomBottom onlyE
leftLeft onlyE

Logical inset: insetInline, insetInlineStart, insetInlineEnd, insetBlock, insetBlockStart, insetBlockEnd — all type C.

Sizing

PropCSS PropertyTypeFallback
widthwidthCFwidth → size
heightheightCFheight → size
minWidthmin-widthCFminWidth → minSize
minHeightmin-heightCFminHeight → minSize
maxWidthmax-widthCFmaxWidth → maxSize
maxHeightmax-heightCFmaxHeight → maxSize
aspectRatioaspect-ratioS—
gapgapC—
inlineSizeinline-sizeC—
blockSizeblock-sizeC—
minInlineSizemin-inline-sizeC—
minBlockSizemin-block-sizeC—
maxInlineSizemax-inline-sizeC—
maxBlockSizemax-block-sizeC—

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

PropCSS PropertyType
flexflexS
flexBasisflex-basisC
flexDirectionflex-directionS
flexFlowflex-flowS
flexGrowflex-growS
flexShrinkflex-shrinkS
flexWrapflex-wrapS
alignItemsalign-itemsS
alignContentalign-contentS
alignSelfalign-selfS
justifyContentjustify-contentS
justifyItemsjustify-itemsS
justifySelfjustify-selfS
placeContentplace-contentS
placeItemsplace-itemsS
placeSelfplace-selfS
rowGaprow-gapC
columnGapcolumn-gapC
orderorderS

Grid

PropCSS PropertyType
gridgridS
gridAreagrid-areaS
gridTemplateColumnsgrid-template-columnsS
gridTemplateRowsgrid-template-rowsS
gridTemplateAreasgrid-template-areasS
gridAutoColumnsgrid-auto-columnsC
gridAutoRowsgrid-auto-rowsC
gridAutoFlowgrid-auto-flowS
gridColumngrid-columnS
gridColumnStartgrid-column-startS
gridColumnEndgrid-column-endS
gridColumnGapgrid-column-gapC
gridRowgrid-rowS
gridRowStartgrid-row-startS
gridRowEndgrid-row-endS
gridRowGapgrid-row-gapC
gridGapgrid-gapC
gridTemplategrid-templateS

Typography

PropCSS PropertyType
fontfontS
fontFamilyfont-familyS
fontSizefont-sizeC
fontSizeAdjustfont-size-adjustS
fontStretchfont-stretchS
fontStylefont-styleS
fontVariantfont-variantS
fontWeightfont-weightS
fontKerningfont-kerningS
fontFeatureSettingsfont-feature-settingsS
fontVariationSettingsfont-variation-settingsS
fontOpticalSizingfont-optical-sizingS
lineHeightline-heightS
letterSpacingletter-spacingC
wordSpacingword-spacingC
textAligntext-alignS
textAlignLasttext-align-lastS
textDecorationtext-decorationS
textDecorationColortext-decoration-colorS
textDecorationLinetext-decoration-lineS
textDecorationStyletext-decoration-styleS
textDecorationThicknesstext-decoration-thicknessC
textUnderlineOffsettext-underline-offsetC
textEmphasistext-emphasisS
textEmphasisColortext-emphasis-colorS
textEmphasisStyletext-emphasis-styleS
textTransformtext-transformS
textShadowtext-shadowS
textOverflowtext-overflowS
textIndenttext-indentC
textJustifytext-justifyS
textWraptext-wrapS
textRenderingtext-renderingS
whiteSpacewhite-spaceS
wordBreakword-breakS
wordWrapword-wrapS
writingModewriting-modeS
directiondirectionS
hyphenshyphensS

Colors & Background

PropCSS PropertyType
colorcolorS
opacityopacityS
backgroundbackgroundS
backgroundColorbackground-colorS
backgroundImagebackground-imageSP (wraps with url())
backgroundAttachmentbackground-attachmentS
backgroundClipbackground-clipS
backgroundOriginbackground-originS
backgroundPositionbackground-positionS
backgroundRepeatbackground-repeatS
backgroundSizebackground-sizeS

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

PropCSS PropertyType
boxShadowbox-shadowS
filterfilterS
backdropFilterbackdrop-filterS
mixBlendModemix-blend-modeS
backgroundBlendModebackground-blend-modeS
isolationisolationS
outlineoutlineS
outlineColoroutline-colorS
outlineOffsetoutline-offsetC
outlineStyleoutline-styleS
outlineWidthoutline-widthC
backfaceVisibilitybackface-visibilityS

Animations & Transforms

PropCSS PropertyType
animation—SP (combines keyframe + animation)
animationNameanimation-nameS
animationDurationanimation-durationS
animationTimingFunctionanimation-timing-functionS
animationDelayanimation-delayS
animationIterationCountanimation-iteration-countS
animationDirectionanimation-directionS
animationFillModeanimation-fill-modeS
animationPlayStateanimation-play-stateS
transitiontransitionS
transitionDelaytransition-delayS
transitionDurationtransition-durationS
transitionPropertytransition-propertyS
transitionTimingFunctiontransition-timing-functionS
transformtransformS
transformOrigintransform-originS
transformStyletransform-styleS
translatetranslateS
rotaterotateS
scalescaleS
willChangewill-changeS

Scroll

PropCSS PropertyType
scrollBehaviorscroll-behaviorS
scrollSnapTypescroll-snap-typeS
scrollSnapAlignscroll-snap-alignS
scrollSnapStopscroll-snap-stopS
scrollMarginscroll-marginC
scrollPaddingscroll-paddingC
overscrollBehavioroverscroll-behaviorS
overscrollBehaviorXoverscroll-behavior-xS
overscrollBehaviorYoverscroll-behavior-yS

Interaction

PropCSS PropertyType
cursorcursorS
pointerEventspointer-eventsS
userSelectuser-selectS
touchActiontouch-actionS
scrollbarWidthscrollbar-widthS
scrollbarColorscrollbar-colorS
scrollbarGutterscrollbar-gutterS
caretColorcaret-colorS
accentColoraccent-colorS
colorSchemecolor-schemeS
appearanceappearanceS
imageRenderingimage-renderingS

Lists

PropCSS PropertyType
listStylelist-styleS
listStyleImagelist-style-imageS
listStylePositionlist-style-positionS
listStyleTypelist-style-typeS

Masks

PropCSS PropertyType
maskImagemask-imageS
maskSizemask-sizeS
maskPositionmask-positionS
maskRepeatmask-repeatS

Shapes

PropCSS PropertyType
shapeOutsideshape-outsideS
shapeMarginshape-marginC
shapeImageThresholdshape-image-thresholdS

Columns

PropCSS PropertyType
columnCountcolumn-countS
columnWidthcolumn-widthC
columnRulecolumn-ruleS
columnscolumnsS

Table & Misc

PropCSS PropertyType
tableLayouttable-layoutS
captionSidecaption-sideS
emptyCellsempty-cellsS
contentcontentS
counterIncrementcounter-incrementS
counterResetcounter-resetS
clearclearS
clipclipS
clipPathclip-pathS
perspectiveperspectiveC
perspectiveOriginperspective-originS
quotesquotesS
tabSizetab-sizeS
objectFitobject-fitS
objectPositionobject-positionS
resizeresizeS
verticalAlignvertical-alignS

Fragmentation (Print)

PropCSS PropertyType
breakBeforebreak-beforeS
breakAfterbreak-afterS
breakInsidebreak-insideS
orphansorphansS
widowswidowsS
printColorAdjustprint-color-adjustS

API Reference

ExtendCss

Prop

Type

Styles

Prop

Type

Edit on GitHub

Last updated on

On this page