Spacing
The spacing utility provides styles to alter the spacing (margins and padding) of the element they're applied to.
Structure
All spacing utility classes share the .cwf-$--&
and .cwf-$__%--&
structure, where:
$
is either themargin
orpadding
property, indicating which property will be modified.%
is one of the following directions:left
,top
,right
, orbottom
. This indicates the side/direction of the property that will be modified.&
is one of the following spacing keywords:auto
,zero
,third
,half
,full
, ordouble
. This indicated the amount of modificating to the specificed property (and optional direction). Theauto
keyword cannot be used in conjunction with thepadding
property. When used with themargin
property, the spacing keyword can be prefixed with--negative
to get the negative value of the spacing amount; This cannot be used in conjunction with theauto
orzero
spacing keywords.
Spacings
The following are the spacing keywords and their respectively values:
auto
:auto
zero
:0
third
:1rem ÷ 3
, or0.3333333333rem
half
:1rem ÷ 2
, or0.5rem
full
:1rem
double
:1rem * 2
, or2rem
Examples
Margin
I'm a paragraph with a double bottom margin (.cwf-margin__bottom--double
).
I'm a paragraph with a third bottom margin (.cwf-margin__bottom--third
).
I'm a regular paragraph.
Padding
I'm a paragraph with full padding (.cwf-padding--full
).
I'm a paragraph with double left padding (.cwf-padding__left--double
).
I'm a regular paragraph.