Skip to main content

Dimentional

The engine supports following length units:

Absolute Lengths

UnitDescription
pxpixels, either dip unit or ppx unit - depends on engine configuration. By default 1px === 1dip
ininches - 1 inch is equal to 2.54 centimeters
cmcentimeters
mmmillimeters
ptpoints - the points used by CSS 2.1 are equal to 1/72nd of an inch
pcpicas - 1 pica is equal to 12 points
dipdevice independent pixels - logical units. 1dip = 1/96 of inch therefore on 96DPI display this will be one pixel. On high-dpi screens it will be resolved to larger number of physical pixels. For example: 2dip will take 3px on 120DPI screen. On printer 'dip' and 'px' units are equivalent.
ppxphysical pixel. On screen 1ppx is exactly one device pixel. On printer 1ppx is equal to 1/96 of inch.

Relative Lengths

UnitDescription
emthe font-size of the relevant font;
remthe font-size of the root font;
exthe x-height of the relevant font;
chwidth of 0 character in the relevant font;
%percent - usually equals to precentage value of correspondent metric of parent element. But not always, see CSS specification.
vw1/100th of view (window) width;
vh1/100th of view (window) height;
vmin1/100th of view's smallest side;
vmax1/100th of view's largest view(window) size.

Width/Height Based Lengths

UnitDescription
width(X%)percentage of width property value. If width is undefined it is treated as auto
height(Y%)percentage of height property value. If height is undefined it is treated as auto
p { 
height: 1.6em;
line-height: height(100%);
}

Flexes

UnitDescription
N*flex unit, reflects weight in distribution of free space
*flex unit, shortcut of 1*

See Flows and Flexes

calc()

The calc() function is supported, but flex units cannot be used inside the calc.