Lesson 51 of 56 · Reference
Style vocabulary reference
Every property you can write in the page language is in this table, and every one works on both targets, web and native. Persian names are shown under the English ones.
States
Any style property can carry one state prefix and then applies only in that state, for example hover background = "#ffeecc". The states are hover, focus, focus within, active, disabled, checked, invalid, placeholder and selection.
Value forms
A bare number uses the natural unit of the property: pixels for lengths, milliseconds for times, degrees for angles.
Percent: 50%. Units: px em rem fr vw vh ms s deg turn.
A comma list continues one property: padding = 8, 16. Brackets group one item of a repeated property: shadow = [0, 4, 8, "black"], [0, 1, 2, "red"].
Colours: "red", "#3366aa", rgb(51, 102, 170), hsl(210, 50%, 40%), mix(red, blue, 30%), light dark(white, black).
Layout of children
These properties go on the element that holds the children.
layout
Values: column row grid stack flow (keyword)
Default: column
Animates: no
Inherited: no
layout = "row"gap
Values: length
Default: 0
Animates: yes
Inherited: no
gap = 8, 16align
Values: start center end stretch baseline (keyword)
Default: stretch
Animates: no
Inherited: no
align = "center"justify
Values: start center end between around evenly (keyword)
Default: start
Animates: no
Inherited: no
justify = "between"align content
Values: start center end stretch between around evenly (keyword)
Default: start
Animates: no
Inherited: no
align content = "center"wrap
Values: true or false
Default: false
Animates: no
Inherited: no
wrap = truereverse
Values: true or false
Default: false
Animates: no
Inherited: no
reverse = truecolumns
Values: none auto min content max content (track list)
Default: none
Animates: no
Inherited: no
columns = 200, 1frrows
Values: none auto min content max content (track list)
Default: none
Animates: no
Inherited: no
rows = "auto", 1frauto columns
Values: auto min content max content (track list)
Default: auto
Animates: no
Inherited: no
auto columns = 1frauto rows
Values: auto min content max content (track list)
Default: auto
Animates: no
Inherited: no
auto rows = 100auto flow
Values: row column dense row dense column dense (keyword)
Default: row
Animates: no
Inherited: no
auto flow = "column"A child in its parent
These properties go on a child and say how it behaves inside its parent.
grow
Values: number
Default: 0
Animates: yes
Inherited: no
grow = 1shrink
Values: number
Default: 1
Animates: yes
Inherited: no
shrink = 0basis
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
basis = 200align self
Values: auto start center end stretch baseline (keyword)
Default: auto
Animates: no
Inherited: no
align self = "end"justify self
Values: auto start center end stretch (keyword)
Default: auto
Animates: no
Inherited: no
justify self = "center"column
Values: auto (integer)
Default: auto
Animates: no
Inherited: no
column = 2row
Values: auto (integer)
Default: auto
Animates: no
Inherited: no
row = 1column span
Values: integer
Default: 1
Animates: no
Inherited: no
column span = 2row span
Values: integer
Default: 1
Animates: no
Inherited: no
row span = 3order
Values: integer
Default: 0
Animates: no
Inherited: no
order = -1position
Values: normal absolute fixed sticky (keyword)
Default: normal
Animates: no
Inherited: no
position = "absolute"top
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
top = 10bottom
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
bottom = 10start
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
start = 10end
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
end = 10
left
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
left = 10right
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
right = 10inset
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
inset = 0layer
Values: integer
Default: 0
Animates: no
Inherited: no
layer = 2Box
Size, space, and what happens to content that does not fit.
width
Values: auto fill fit min content max content (length)
Default: auto
Animates: yes
Inherited: no
width = 50%height
Values: auto fill fit min content max content (length)
Default: auto
Animates: yes
Inherited: no
height = 100% - 20min width
Values: auto fit min content max content (length)
Default: auto
Animates: yes
Inherited: no
min width = 120min height
Values: auto fit min content max content (length)
Default: auto
Animates: yes
Inherited: no
min height = 40max width
Values: none fit min content max content (length)
Default: none
Animates: yes
Inherited: no
max width = 600max height
Values: none fit min content max content (length)
Default: none
Animates: yes
Inherited: no
max height = 80vhaspect ratio
Values: none (number)
Default: none
Animates: yes
Inherited: no
aspect ratio = 1.5padding
Values: length
Default: 0
Animates: yes
Inherited: no
padding = 8, 16padding top
Values: length
Default: 0
Animates: yes
Inherited: no
padding top = 12padding bottom
Values: length
Default: 0
Animates: yes
Inherited: no
padding bottom = 12padding start
Values: length
Default: 0
Animates: yes
Inherited: no
padding start = 12padding end
Values: length
Default: 0
Animates: yes
Inherited: no
padding end = 12padding left
Values: length
Default: 0
Animates: yes
Inherited: no
padding left = 12padding right
Values: length
Default: 0
Animates: yes
Inherited: no
padding right = 12padding x
Values: length
Default: 0
Animates: yes
Inherited: no
padding x = 12padding y
Values: length
Default: 0
Animates: yes
Inherited: no
padding y = 12margin
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin = 0, "auto"margin top
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin top = 8margin bottom
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin bottom = 8margin start
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin start = 8margin end
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin end = 8margin left
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin left = 8margin right
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin right = 8margin x
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin x = 8margin y
Values: auto (length)
Default: 0
Animates: yes
Inherited: no
margin y = 8overflow
Values: visible hidden scroll auto (keyword)
Default: visible
Animates: no
Inherited: no
overflow = "hidden"overflow x
Values: visible hidden scroll auto (keyword)
Default: visible
Animates: no
Inherited: no
overflow x = "auto"overflow y
Values: visible hidden scroll auto (keyword)
Default: visible
Animates: no
Inherited: no
overflow y = "scroll"visible
Values: true or false
Default: true
Animates: no
Inherited: no
visible = falseclip
Values: true or false
Default: false
Animates: no
Inherited: no
clip = trueLook
Backgrounds, borders, shadows, filters, transforms and the pointer.
background
Values: none (paint)
Default: transparent
Animates: yes
Inherited: no
background = linear(90, #3366aa, white)background size
Values: auto cover contain (length)
Default: auto
Animates: yes
Inherited: no
background size = "cover"background position
Values: center top bottom start end left right (length)
Default: start, top
Animates: yes
Inherited: no
background position = "center"background repeat
Values: true false x y (keyword)
Default: false
Animates: no
Inherited: no
background repeat = "x"border
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border = 1, "solid", "#3366aa"border top
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border top = 2, "dashed", "red"border bottom
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border bottom = 2, "dashed", "red"border start
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border start = 2, "dashed", "red"border end
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border end = 2, "dashed", "red"border left
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border left = 2, "dashed", "red"border right
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
border right = 2, "dashed", "red"border width
Values: length
Default: 0
Animates: yes
Inherited: no
border width = 1, 0border style
Values: solid dashed dotted double none (keyword)
Default: solid
Animates: no
Inherited: no
border style = "dashed"border color
Values: colour
Default: current
Animates: yes
Inherited: no
border color = "#cccccc"radius
Values: length
Default: 0
Animates: yes
Inherited: no
radius = 8radius top start
Values: length
Default: 0
Animates: yes
Inherited: no
radius top start = 12radius top end
Values: length
Default: 0
Animates: yes
Inherited: no
radius top end = 12radius bottom end
Values: length
Default: 0
Animates: yes
Inherited: no
radius bottom end = 12radius bottom start
Values: length
Default: 0
Animates: yes
Inherited: no
radius bottom start = 12outline
Values: solid dashed dotted double none (width, style, colour)
Default: 0, solid, current
Animates: yes
Inherited: no
outline = 2, "solid", "#3366aa"outline offset
Values: length
Default: 0
Animates: yes
Inherited: no
outline offset = 2shadow
Values: none inset (x, y, blur, spread, colour)
Default: none
Animates: yes
Inherited: no
shadow = 0, 4, 8, "#00000040"opacity
Values: number
Default: 1
Animates: yes
Inherited: no
opacity = 0.5blur
Values: length
Default: 0
Animates: yes
Inherited: no
blur = 4brightness
Values: number
Default: 1
Animates: yes
Inherited: no
brightness = 1.2contrast
Values: number
Default: 1
Animates: yes
Inherited: no
contrast = 1.5grayscale
Values: number
Default: 0
Animates: yes
Inherited: no
grayscale = 1saturate
Values: number
Default: 1
Animates: yes
Inherited: no
saturate = 2sepia
Values: number
Default: 0
Animates: yes
Inherited: no
sepia = 0.6invert
Values: number
Default: 0
Animates: yes
Inherited: no
invert = 1hue rotate
Values: angle
Default: 0
Animates: yes
Inherited: no
hue rotate = 90backdrop blur
Values: length
Default: 0
Animates: yes
Inherited: no
backdrop blur = 4backdrop brightness
Values: number
Default: 1
Animates: yes
Inherited: no
backdrop brightness = 1.2backdrop contrast
Values: number
Default: 1
Animates: yes
Inherited: no
backdrop contrast = 1.5backdrop grayscale
Values: number
Default: 0
Animates: yes
Inherited: no
backdrop grayscale = 1backdrop saturate
Values: number
Default: 1
Animates: yes
Inherited: no
backdrop saturate = 2backdrop sepia
Values: number
Default: 0
Animates: yes
Inherited: no
backdrop sepia = 0.6backdrop invert
Values: number
Default: 0
Animates: yes
Inherited: no
backdrop invert = 1backdrop hue rotate
Values: angle
Default: 0
Animates: yes
Inherited: no
backdrop hue rotate = 90blend
Values: normal multiply screen overlay darken lighten color dodge color burn hard light soft light difference exclusion hue saturation color luminosity (keyword)
Default: normal
Animates: no
Inherited: no
blend = "multiply"translate
Values: length
Default: 0
Animates: yes
Inherited: no
translate = 10, -4rotate
Values: angle
Default: 0
Animates: yes
Inherited: no
rotate = 45scale
Values: number
Default: 1
Animates: yes
Inherited: no
scale = 1.5skew
Values: angle
Default: 0
Animates: yes
Inherited: no
skew = 10, 0origin
Values: center top bottom start end left right (length)
Default: center
Animates: yes
Inherited: no
origin = "top", "start"cursor
Values: auto default none pointer text move grab grabbing not allowed wait progress crosshair help resize resize x resize y zoom in zoom out (keyword)
Default: auto
Animates: no
Inherited: yes
cursor = "pointer"interactive
Values: true or false
Default: true
Animates: no
Inherited: yes
interactive = falseselectable
Values: true or false
Default: true
Animates: no
Inherited: yes
selectable = falseimage fit
Values: fill contain cover none scale down (keyword)
Default: fill
Animates: no
Inherited: no
image fit = "cover"accent
Values: colour
Default: #1a73e8
Animates: yes
Inherited: yes
accent = "#3366aa"caret
Values: colour
Default: current
Animates: yes
Inherited: yes
caret = "red"scrollbar
Values: auto thin none (keyword)
Default: auto
Animates: no
Inherited: no
scrollbar = "thin"scrollbar color
Values: colour
Default: #00000066, transparent
Animates: yes
Inherited: yes
scrollbar color = "#888888", "#eeeeee"Text
Text properties are inherited: set them on a box and every text inside takes them.
color
Values: colour
Default: #000000
Animates: yes
Inherited: yes
color = "#333333"font
Values: sans serif mono system (font family list)
Default: sans
Animates: no
Inherited: yes
font = "Vazirmatn", "sans"font size
Values: length
Default: 16
Animates: yes
Inherited: yes
font size = 1.25emfont weight
Values: thin light normal medium semibold bold black (number)
Default: normal
Animates: yes
Inherited: yes
font weight = "bold"italic
Values: true or false
Default: false
Animates: no
Inherited: yes
italic = trueline height
Values: number
Default: 1.5
Animates: yes
Inherited: yes
line height = 1.8letter spacing
Values: length
Default: 0
Animates: yes
Inherited: yes
letter spacing = 0.05emword spacing
Values: length
Default: 0
Animates: yes
Inherited: yes
word spacing = 4text align
Values: start center end justify left right (keyword)
Default: start
Animates: no
Inherited: yes
text align = "center"decoration
Values: none underline overline strike (keyword)
Default: none
Animates: no
Inherited: no
decoration = "underline"decoration color
Values: colour
Default: current
Animates: yes
Inherited: no
decoration color = "red"decoration style
Values: solid dashed dotted double wavy (keyword)
Default: solid
Animates: no
Inherited: no
decoration style = "wavy"decoration thickness
Values: auto (length)
Default: auto
Animates: yes
Inherited: no
decoration thickness = 2transform text
Values: none upper lower capitalize (keyword)
Default: none
Animates: no
Inherited: yes
transform text = "upper"wrap text
Values: true or false
Default: true
Animates: no
Inherited: yes
wrap text = falsemax lines
Values: none (integer)
Default: none
Animates: no
Inherited: no
max lines = 2ellipsis
Values: true or false
Default: false
Animates: no
Inherited: no
ellipsis = truedirection
Values: auto rtl ltr (keyword)
Default: auto
Animates: no
Inherited: yes
direction = "rtl"white space
Values: normal keep (keyword)
Default: normal
Animates: no
Inherited: yes
white space = "keep"text shadow
Values: none (x, y, blur, colour)
Default: none
Animates: yes
Inherited: yes
text shadow = 0, 1, 2, "#00000080"font features
Values: none (list of strings)
Default: none
Animates: no
Inherited: yes
font features = "tnum", "ss01"Motion
A change of a property can take time instead of jumping.
transition
Values: none (time, easing, delay)
Default: none
Animates: no
Inherited: no
transition = 200ms, "ease out"transition properties
Values: all (property names)
Default: all
Animates: no
Inherited: no
transition properties = "opacity", "background"tab size
Values: integer
Default: 8
Animates: no
Inherited: yes
tab size = 4touch action
Values: auto none pan x pan y pinch manipulation (keyword)
Default: auto
Animates: no
Inherited: no
touch action = "pan y"