Skip to content

Margin & Padding

Margin and Padding Modifiers

The margin (abbreviated as mg) and padding (abbreviated as pd) properties support various spacing configurations. You can use spacing tokens to define the values, with the following syntax:


Margin Modifiers

ModifierExpected ValuesExample
Margin Values (All Sides)SpacingToken (e.g., d3)mg:d2
(X/Y)SpacingToken (e.g., d3)mg:d2:d3 (First value applies to the X axis and second value applies to the Y axis)
(Individual Sides)SpacingToken (e.g., d3)mg:d2:d3:d4:d5

Padding Modifiers

ModifierExpected ValuesExample
Padding Values (All Sides)SpacingToken (e.g., d3)pd:d2
(X/Y)SpacingToken (e.g., d3)pd:d2:d3 (First value applies to the X axis and second value applies to the Y axis)
(Individual Sides)SpacingToken (e.g., d3)pd:d2:d3:d4:d5


Elevate also supports single directional properties for margin and padding such as:

Single Directional PropertiesExpected ValuesExample
pd-tSpacingToken (e.g., d3)pd-t:d2
pd-bSpacingToken (e.g., d3)pd-b:d2
pd-lSpacingToken (e.g., d3)pd-l:d2
pd-rSpacingToken (e.g., d3)pd-r:d2
mg-tSpacingToken (e.g., d3)mg-t:d2
mg-bSpacingToken (e.g., d3)mg-b:d2
mg-lSpacingToken (e.g., d3)mg-l:d2
mg-rSpacingToken (e.g., d3)mg-r:d2