Style Macros Reference

Sizing

MacroDescriptionExample
w(n)Fixed widthw(200)
h(n)Fixed heighth(100)
w_fillFill parent widthw_fill
h_fillFill parent heighth_fill
w_fitFit content widthw_fit
h_fitFit content heighth_fit
minW(n)Minimum widthminW(100)
maxW(n)Maximum widthmaxW(500)
minH(n)Minimum heightminH(50)
maxH(n)Maximum heightmaxH(300)

Futher reference for sizing styling

Spacing

MacroDescriptionExample
m(n)Margin (all sides)m(10)
mx(n)Margin horizontalmx(15)
my(n)Margin verticalmy(10)
mt/mr/mb/ml(n)Individual marginsmt(5)
p(n)Padding (all sides)p(20)
px(n)Padding horizontalpx(15)
py(n)Padding verticalpy(10)
pt/pr/pb/pl(n)Individual paddingpt(5)

Futher reference for margin and padding styling

Colors

MacroDescriptionExample
bg(r,g,b)Background colorbg(45,45,45)
bg(r,g,b,a)Background with alphabg(45,45,45,200)
textColour(r,g,b)Text colortextColour(255,255,255)
rgb(r,g,b)Color helperbg(rgb(45,45,45))
rgba(r,g,b,a)RGBA helperbg(rgba(45,45,45,200))

Futher reference for colour styling

Layout

MacroDescriptionExample
up_downChildren top→bottomup_down
down_upChildren bottom→topdown_up
left_rightChildren left→rightleft_right
right_leftChildren right→leftright_left
centerXCenter horizontallycenterX
centerYCenter verticallycenterY
centerXYCenter both axescenterXY

Futher reference for layout directions and centering

Text

MacroDescriptionExample
fontSize(n)Font size in pixelsfontSize(16)
lineHeight(n)Line height multiplierlineHeight(1.5)
justify_leftAlign text leftjustify_left
justify_centerCenter textjustify_center
justify_rightAlign text rightjustify_right
textWrap(bool)Enable/disable wrappingtextWrap(false)

Futher reference for text-based properties

Visual

MacroDescriptionExample
rounded(n)Border radiusrounded(8)
absolutePos(x,y)Absolute positionabsolute(100,50)

[!WARNING] Absolute positioning can mess up the layout tree significantly. For most use cases that require absolute positioning, it is recomended you use them with a CustomTargetQueue which is seperate to the default element tree. You can find out more about it in Advanced Topics and can view documented implmentations of specific use cases like that require absolute positioning and custom render targets like modals.





Card image

Styling Guide

In-depth guide for all style modifiers

Card image

Event Handling

Add interactivity with onClick, onHover, etc.

Card image

Examples

See real applications