Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CSS Property Reference

This page lists every CSS property supported by the css! macro, grouped by category. Properties not listed here produce a compile-time error.

Layout

PropertyValues
displayflex | block | none | grid
visibilityhidden | visible
overflowhidden | scroll | visible | clip | auto
overflow-xhidden | scroll | visible | clip | auto
overflow-yhidden | scroll | visible | clip | auto
positionrelative | absolute
flex-directionrow | column | row-reverse | column-reverse
flex-wrapnowrap | wrap | wrap-reverse
flexnone | auto | N (grow) | N N (grow shrink, basis 0px) | N N basis
flex-grownumber
flex-shrinknumber
flex-basislength
justify-contentflex-start | flex-end | center | space-between | space-around | space-evenly
align-itemsflex-start | flex-end | center | baseline | stretch
align-selfsame as align-items
align-contentflex-start | flex-end | center | space-between | space-around | stretch | space-evenly
gaplength | length length
row-gaplength
column-gaplength
grid-template-columnsnumber (column count)
grid-template-rowsnumber (row count)
grid-columnspan N | A / B | N
grid-column-startnumber
grid-column-endnumber
grid-rowspan N | A / B | N
grid-row-startnumber
grid-row-endnumber
grid-template-areasstring literals (rows of whitespace-separated cell names; . = empty cell). Infers grid-template-columns/-rows counts.
grid-area"name" (resolves against grid-template-areas) | N | row / col | row-start / col-start / row-end / col-end
scrollbar-widthauto | thin | none

Box Model

PropertyValues
widthlength
heightlength
min-widthlength
min-heightlength
max-widthlength
max-heightlength
paddinglength | length length | length length length length
padding-toplength
padding-rightlength
padding-bottomlength
padding-leftlength
padding-inlinelength (sets left + right)
padding-blocklength (sets top + bottom)
marginlength | length length | length length length length
margin-toplength
margin-rightlength
margin-bottomlength
margin-leftlength
margin-inlinelength (sets left + right)
margin-blocklength (sets top + bottom)
insetlength | length length | length length length length
toplength
rightlength
bottomlength
leftlength
aspect-rationumber

Visual

PropertyValues
backgroundcolor | linear-gradient(angle, from, to)
background-colorcolor
colorcolor
opacitynumber (0.0–1.0)
borderwidth style color (e.g. 1px solid #ccc)
border-topwidth style color (one side)
border-rightwidth style color (one side)
border-bottomwidth style color (one side)
border-leftwidth style color (one side)
border-colorcolor
border-stylesolid | dashed
border-widthlength
border-top-widthlength
border-right-widthlength
border-bottom-widthlength
border-left-widthlength
border-radiuslength
border-top-left-radiuslength
border-top-right-radiuslength
border-bottom-right-radiuslength
border-bottom-left-radiuslength
cursorpointer | default | text | crosshair | not-allowed | grab | grabbing
box-shadownone | sm | md | lg | xl | [inset]? <offset-x> <offset-y> <blur>? <spread>? <color>?

Text

PropertyValues
font-sizelength (not %)
font-weightthin | extra-light | light | normal | medium | semibold | bold | extrabold | black | 100–900
font-styleitalic | normal
font-familystring literal or keyword
text-alignleft | center | right
text-decorationunderline | line-through | none
text-decoration-colorcolor
text-decoration-thicknesslength
text-decoration-stylesolid | wavy
text-overflowellipsis | clip
text-backgroundcolor
text-background-colorcolor
white-spacenowrap | normal
line-heightnumber (unitless → relative) or length
line-clampnumber

Unsupported Properties

The following common CSS properties are not supported by css! because gpui’s styling model does not provide equivalents:

  • transform / translate / rotate / scale
  • transition / animation — use tw! transition-* / animate-* utilities instead. See Animations & Transitions.
  • z-index (use tw! z-N utilities instead)
  • box-sizing (gpui uses content-box semantics)
  • gap with more than 2 values
  • outline (use border instead)
  • list-style / list-style-type
  • background-image (use linear-gradient in background instead)
  • background-position / background-size / background-repeat
  • float / clear
  • @media queries / responsive breakpoints — use tw! responsive prefixes sm:/md:/lg:/xl: instead. See Tailwind Classes.
  • !important

If you need a property not listed here, check whether a tw! utility covers it, or use gpui’s styled element methods directly outside of css!.