Vitus Labs
Unistyle

CSS Properties

170+ 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.

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, lineHeight: 1.5 }
// With rootSize=16:
// → font-size: 1rem; gap: 1.5rem; line-height: 1.5rem;

{ fontSize: '2em', gap: 'auto' }
// → font-size: 2em; gap: auto;

Properties: fontSize, gap, rowGap, columnGap, gridAutoRows, gridAutoColumns, lineHeight, letterSpacing

convert_fallback — Fallback Chain + Conversion

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

CSS PropertyFallback Chain
widthwidthsize
heightheightsize
min-widthminWidthminSize
min-heightminHeightminSize
max-widthmaxWidthmaxSize
max-heightmaxHeightmaxSize
{ 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' (string with unit)'16px' (unchanged)'16px' (unchanged)
'auto' (keyword)'auto' (unchanged)'auto' (unchanged)
null / undefinedSkippedSkipped

Only the convert, convert_fallback, and edge descriptor types perform unit conversion. simple descriptors pass values through unchanged.

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
widthwidthCFwidthsize
heightheightCFheightsize
minWidthmin-widthCFminWidthminSize
minHeightmin-heightCFminHeightminSize
maxWidthmax-widthCFmaxWidthmaxSize
maxHeightmax-heightCFmaxHeightmaxSize
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-basisS
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-startC
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-adjustC
fontStretchfont-stretchC
fontStylefont-styleS
fontVariantfont-variantS
fontWeightfont-weightS
fontKerningfont-kerningS
fontFeatureSettingsfont-feature-settingsS
fontVariationSettingsfont-variation-settingsS
fontOpticalSizingfont-optical-sizingS
lineHeightline-heightS
letterSpacingletter-spacingS
wordSpacingword-spacingS
textAligntext-alignS
textAlignLasttext-align-lastS
textDecorationtext-decorationS
textDecorationColortext-decoration-colorS
textDecorationLinetext-decoration-lineS
textDecorationStyletext-decoration-styleS
textDecorationThicknesstext-decoration-thicknessS
textUnderlineOffsettext-underline-offsetS
textEmphasistext-emphasisS
textEmphasisColortext-emphasis-colorS
textEmphasisStyletext-emphasis-styleS
textTransformtext-transformS
textShadowtext-shadowS
textOverflowtext-overflowS
textIndenttext-indentS
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 (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-offsetS
outlineStyleoutline-styleS
outlineWidthoutline-widthS
backfaceVisibilitybackface-visibilityS

Animations & Transforms

PropCSS PropertyType
animationSP (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-marginS
scrollPaddingscroll-paddingS
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-marginS
shapeImageThresholdshape-image-thresholdS

Columns

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

Table & Misc

PropCSS PropertyType
tableLayouttable-layoutS
captionSidecaption-sideS
emptyCellsempty-cellsS
contentcontentS
counterIncrementcounter-incrementS
counterResetcounter-resetS
clearclearS
clipclipS
clipPathclip-pathS
perspectiveperspectiveS
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

On this page