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:pxemremfrvwvhmssdegturn. - 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.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
layoutچیدمان | column row grid stack flow (keyword) | column | no | no | layout = row |
gapشکاف | length | 0 | yes | no | gap = 8, 16 |
alignتراز | start center end stretch baseline (keyword) | stretch | no | no | align = center |
justifyچینش | start center end between around evenly (keyword) | start | no | no | justify = between |
align contentمحتوا تراز | start center end stretch between around evenly (keyword) | start | no | no | align content = center |
wrapپیچش | true or false | false | no | no | wrap = true |
reverseمعکوس | true or false | false | no | no | reverse = true |
columnsستونها | none auto min content max content (track list) | none | no | no | columns = 200, 1fr |
rowsردیفها | none auto min content max content (track list) | none | no | no | rows = auto, 1fr |
auto columnsستونهای خودکار | auto min content max content (track list) | auto | no | no | auto columns = 1fr |
auto rowsردیفهای خودکار | auto min content max content (track list) | auto | no | no | auto rows = 100 |
auto flowجریان خودکار | row column dense row dense column dense (keyword) | row | no | no | auto flow = column |
A child in its parent
These properties go on a child and say how it behaves inside its parent.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
growرشد | number | 0 | yes | no | grow = 1 |
shrinkجمعشدن | number | 1 | yes | no | shrink = 0 |
basisپایه | auto (length) | auto | yes | no | basis = 200 |
align selfخود تراز | auto start center end stretch baseline (keyword) | auto | no | no | align self = end |
justify selfخود چینش | auto start center end stretch (keyword) | auto | no | no | justify self = center |
columnستون | auto (integer) | auto | no | no | column = 2 |
rowردیف | auto (integer) | auto | no | no | row = 1 |
column spanگستره ستون | integer | 1 | no | no | column span = 2 |
row spanگستره ردیف | integer | 1 | no | no | row span = 3 |
orderترتیب نمایش | integer | 0 | no | no | order = -1 |
positionموقعیت | normal absolute fixed sticky (keyword) | normal | no | no | position = absolute |
topبالا | auto (length) | auto | yes | no | top = 10 |
bottomپایین | auto (length) | auto | yes | no | bottom = 10 |
startابتدا | auto (length) | auto | yes | no | start = 10 |
endانتها | auto (length) | auto | yes | no | end = 10 |
leftچپ | auto (length) | auto | yes | no | left = 10 |
rightراست | auto (length) | auto | yes | no | right = 10 |
insetفاصله از لبه | auto (length) | auto | yes | no | inset = 0 |
layerلایه | integer | 0 | no | no | layer = 2 |
Box
Size, space, and what happens to content that does not fit.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
widthعرض | auto fill fit min content max content (length) | auto | yes | no | width = 50% |
heightارتفاع | auto fill fit min content max content (length) | auto | yes | no | height = 100% - 20 |
min widthکمینه عرض | auto fit min content max content (length) | auto | yes | no | min width = 120 |
min heightکمینه ارتفاع | auto fit min content max content (length) | auto | yes | no | min height = 40 |
max widthبیشینه عرض | none fit min content max content (length) | none | yes | no | max width = 600 |
max heightبیشینه ارتفاع | none fit min content max content (length) | none | yes | no | max height = 80vh |
aspect ratioنسبت ابعاد | none (number) | none | yes | no | aspect ratio = 1.5 |
paddingفاصله | length | 0 | yes | no | padding = 8, 16 |
padding topفاصله بالا | length | 0 | yes | no | padding top = 12 |
padding bottomفاصله پایین | length | 0 | yes | no | padding bottom = 12 |
padding startفاصله ابتدا | length | 0 | yes | no | padding start = 12 |
padding endفاصله انتها | length | 0 | yes | no | padding end = 12 |
padding leftفاصله چپ | length | 0 | yes | no | padding left = 12 |
padding rightفاصله راست | length | 0 | yes | no | padding right = 12 |
padding xفاصله افقی | length | 0 | yes | no | padding x = 12 |
padding yفاصله عمودی | length | 0 | yes | no | padding y = 12 |
marginفضا | auto (length) | 0 | yes | no | margin = 0, auto |
margin topفضا بالا | auto (length) | 0 | yes | no | margin top = 8 |
margin bottomفضا پایین | auto (length) | 0 | yes | no | margin bottom = 8 |
margin startفضا ابتدا | auto (length) | 0 | yes | no | margin start = 8 |
margin endفضا انتها | auto (length) | 0 | yes | no | margin end = 8 |
margin leftفضا چپ | auto (length) | 0 | yes | no | margin left = 8 |
margin rightفضا راست | auto (length) | 0 | yes | no | margin right = 8 |
margin xفضا افقی | auto (length) | 0 | yes | no | margin x = 8 |
margin yفضا عمودی | auto (length) | 0 | yes | no | margin y = 8 |
overflowسرریز | visible hidden scroll auto (keyword) | visible | no | no | overflow = hidden |
overflow xسرریز افقی | visible hidden scroll auto (keyword) | visible | no | no | overflow x = auto |
overflow yسرریز عمودی | visible hidden scroll auto (keyword) | visible | no | no | overflow y = scroll |
visibleنمایان | true or false | true | no | no | visible = false |
clipبرش | true or false | false | no | no | clip = true |
Look
Backgrounds, borders, shadows, filters, transforms and the pointer.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
backgroundپسزمینه | none (paint) | transparent | yes | no | background = linear(90, #3366aa, white) |
background sizeاندازه پسزمینه | auto cover contain (length) | auto | yes | no | background size = cover |
background positionموقعیت پسزمینه | center top bottom start end left right (length) | start, top | yes | no | background position = center |
background repeatتکرار پسزمینه | true false x y (keyword) | false | no | no | background repeat = x |
borderکادر | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border = 1, solid, #3366aa |
border topکادر بالا | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border top = 2, dashed, red |
border bottomکادر پایین | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border bottom = 2, dashed, red |
border startکادر ابتدا | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border start = 2, dashed, red |
border endکادر انتها | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border end = 2, dashed, red |
border leftکادر چپ | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border left = 2, dashed, red |
border rightکادر راست | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | border right = 2, dashed, red |
border widthضخامت کادر | length | 0 | yes | no | border width = 1, 0 |
border styleسبک کادر | solid dashed dotted double none (keyword) | solid | no | no | border style = dashed |
border colorرنگ کادر | colour | current | yes | no | border color = #cccccc |
radiusگردی | length | 0 | yes | no | radius = 8 |
radius top startگردی بالا ابتدا | length | 0 | yes | no | radius top start = 12 |
radius top endگردی بالا انتها | length | 0 | yes | no | radius top end = 12 |
radius bottom endگردی پایین انتها | length | 0 | yes | no | radius bottom end = 12 |
radius bottom startگردی پایین ابتدا | length | 0 | yes | no | radius bottom start = 12 |
outlineدورخط | solid dashed dotted double none (width, style, colour) | 0, solid, current | yes | no | outline = 2, solid, #3366aa |
outline offsetفاصله دورخط | length | 0 | yes | no | outline offset = 2 |
shadowسایه | none inset (x, y, blur, spread, colour) | none | yes | no | shadow = 0, 4, 8, #00000040 |
opacityشفافیت | number | 1 | yes | no | opacity = 0.5 |
blurتاری | length | 0 | yes | no | blur = 4 |
brightnessروشنایی | number | 1 | yes | no | brightness = 1.2 |
contrastکنتراست | number | 1 | yes | no | contrast = 1.5 |
grayscaleخاکستری | number | 0 | yes | no | grayscale = 1 |
saturateاشباع رنگ | number | 1 | yes | no | saturate = 2 |
sepiaسپیا | number | 0 | yes | no | sepia = 0.6 |
invertوارونگی | number | 0 | yes | no | invert = 1 |
hue rotateچرخش فام | angle | 0 | yes | no | hue rotate = 90 |
backdrop blurتاری پشت | length | 0 | yes | no | backdrop blur = 4 |
backdrop brightnessروشنایی پشت | number | 1 | yes | no | backdrop brightness = 1.2 |
backdrop contrastکنتراست پشت | number | 1 | yes | no | backdrop contrast = 1.5 |
backdrop grayscaleخاکستری پشت | number | 0 | yes | no | backdrop grayscale = 1 |
backdrop saturateاشباع رنگ پشت | number | 1 | yes | no | backdrop saturate = 2 |
backdrop sepiaسپیا پشت | number | 0 | yes | no | backdrop sepia = 0.6 |
backdrop invertوارونگی پشت | number | 0 | yes | no | backdrop invert = 1 |
backdrop hue rotateچرخش فام پشت | angle | 0 | yes | no | backdrop hue rotate = 90 |
blendآمیختگی | normal multiply screen overlay darken lighten color dodge color burn hard light soft light difference exclusion hue saturation color luminosity (keyword) | normal | no | no | blend = multiply |
translateجابهجایی | length | 0 | yes | no | translate = 10, -4 |
rotateچرخش | angle | 0 | yes | no | rotate = 45 |
scaleمقیاس | number | 1 | yes | no | scale = 1.5 |
skewکجی | angle | 0 | yes | no | skew = 10, 0 |
originمبدا | center top bottom start end left right (length) | center | yes | no | origin = top, start |
cursorنشانگر | auto default none pointer text move grab grabbing not allowed wait progress crosshair help resize resize x resize y zoom in zoom out (keyword) | auto | no | yes | cursor = pointer |
interactiveتعاملی | true or false | true | no | yes | interactive = false |
selectableانتخابپذیر | true or false | true | no | yes | selectable = false |
image fitجاگیری تصویر | fill contain cover none scale down (keyword) | fill | no | no | image fit = cover |
accentرنگ تاکید | colour | #1a73e8 | yes | yes | accent = #3366aa |
caretرنگ نشانگر متن | colour | current | yes | yes | caret = red |
scrollbarنوار پیمایش | auto thin none (keyword) | auto | no | no | scrollbar = thin |
scrollbar colorرنگ نوار پیمایش | colour | #00000066, transparent | yes | yes | scrollbar color = #888888, #eeeeee |
Text
Text properties are inherited: set them on a box and every text inside takes them.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
colorرنگ | colour | #000000 | yes | yes | color = #333333 |
fontقلم | sans serif mono system (font family list) | sans | no | yes | font = "Vazirmatn", sans |
font sizeاندازه قلم | length | 16 | yes | yes | font size = 1.25em |
font weightوزن قلم | thin light normal medium semibold bold black (number) | normal | yes | yes | font weight = bold |
italicکج | true or false | false | no | yes | italic = true |
line heightارتفاع خط | number | 1.5 | yes | yes | line height = 1.8 |
letter spacingفاصله حروف | length | 0 | yes | yes | letter spacing = 0.05em |
word spacingفاصله واژهها | length | 0 | yes | yes | word spacing = 4 |
text alignتراز متن | start center end justify left right (keyword) | start | no | yes | text align = center |
decorationتزیین متن | none underline overline strike (keyword) | none | no | no | decoration = underline |
decoration colorرنگ تزیین متن | colour | current | yes | no | decoration color = red |
decoration styleسبک تزیین متن | solid dashed dotted double wavy (keyword) | solid | no | no | decoration style = wavy |
decoration thicknessضخامت تزیین متن | auto (length) | auto | yes | no | decoration thickness = 2 |
transform textدگرگونی متن | none upper lower capitalize (keyword) | none | no | yes | transform text = upper |
wrap textپیچش متن | true or false | true | no | yes | wrap text = false |
max linesبیشینه سطرها | none (integer) | none | no | no | max lines = 2 |
ellipsisسهنقطه | true or false | false | no | no | ellipsis = true |
directionجهت متن | auto rtl ltr (keyword) | auto | no | yes | direction = rtl |
white spaceفضای سفید | normal keep (keyword) | normal | no | yes | white space = keep |
text shadowسایه متن | none (x, y, blur, colour) | none | yes | yes | text shadow = 0, 1, 2, #00000080 |
font featuresویژگیهای قلم | none (list of strings) | none | no | yes | font features = "tnum", "ss01" |
Motion
A change of a property can take time instead of jumping.
| Property | Values | Default | Animates | Inherited | Example |
|---|---|---|---|---|---|
transitionگذار | none (time, easing, delay) | none | no | no | transition = 200ms, ease out |
transition propertiesویژگیهای گذار | all (property names) | all | no | no | transition properties = opacity, background |
tab sizeاندازه تب | integer | 8 | no | yes | tab size = 4 |
touch actionکنش لمس | auto none pan x pan y pinch manipulation (keyword) | auto | no | no | touch action = pan y |