Spacing utilities let you manage spacing inside or outside elements. See the showcase tab to have an overview of it.
Margin
Different clases can be used to set the margin around an element. All spacing values are listed on guidelines.
Available values are:
ecl-u-ma-*
(ecl-u-ma-2xs to ecl-u-ma-6xl): all around marginsecl-u-mv-*
(ecl-u-mv-2xs to ecl-u-mv-6xl): vertical marginsecl-u-mh-*
(ecl-u-mh-2xs to ecl-u-mh-6xl): horizontal marginsecl-u-mt-*
(ecl-u-mt-2xs to ecl-u-mt-6xl): top marginsecl-u-mr-*
(ecl-u-mr-2xs to ecl-u-mr-6xl): right/end marginsecl-u-mb-*
(ecl-u-mb-2xs to ecl-u-mb-6xl): bottom marginsecl-u-ml-*
(ecl-u-ml-2xs to ecl-u-ml-6xl): left/start margins
Margin auto or none
All margin classes listed ahead can also be set to auto or none.
For instance:
ecl-u-ma-none
: all around margin set to 0ecl-u-mv-none
: vertical margin set to 0ecl-u-mh-auto
: horizontal margin set to autoecl-u-mr-auto
: end margin set to auto
Padding
Different clases can be used to set the padding inside an element. All spacing values are listed on guidelines.
Available values are:
ecl-u-pa-*
(ecl-u-pa-2xs to ecl-u-pa-6xl): all around paddingecl-u-pv-*
(ecl-u-pv-2xs to ecl-u-pv-6xl): vertical paddingecl-u-ph-*
(ecl-u-ph-2xs to ecl-u-ph-6xl): horizontal paddingecl-u-pt-*
(ecl-u-pt-2xs to ecl-u-pt-6xl): top paddingecl-u-pr-*
(ecl-u-pr-2xs to ecl-u-pr-6xl): right/end paddingecl-u-pb-*
(ecl-u-pb-2xs to ecl-u-pb-6xl): bottom paddingecl-u-pl-*
(ecl-u-pl-2xs to ecl-u-pl-6xl): left/start padding
Padding none
All padding classes listed ahead can also be set to none.
For instance:
ecl-u-pa-none
: all around padding set to 0ecl-u-pv-none
: vertical padding set to 0
Responsive spacing
Add the breakpoint before spacing size to display it only with corresponding screen size (works for all kind of spacing ahead).
Examples:
ecl-u-ma-m-l
: marginl
on screen size >= breakpointm
ecl-u-ph-l-2xl
: horizontal padding2xl
on screen size >= breakpointl
ecl-u-ml-s-none
: no start margin on screen size >= breakpoints
Right to left spacing
All the spacing utilities are compatible with right to left text. CSS rules used are margin|padding-inline-start
and margin|padding-inline-end
instead of left and right.