Spacing
Notation #
Spacing utility classes can be defined using the format -{property}{sides}[-{breakpoint}]--{size}.
{property} #
m- use to applymarginp- use to applypadding
{sides} #
t- use to applymargin-toporpadding-topb- use to applymargin-bottomorpadding-bottoml- use to applymargin-leftorpadding-leftr- use to applymargin-rightorpadding-rightx- use to applymargin-leftandmargin-rightorpadding-leftandpadding-righty- use to applymargin-topandmargin-bottomorpadding-topandpadding-bottom- blank - leave blank to apply
marginorpaddingto all 4 sides.
{breakpoint} #
Optionally, include -{breakpoint} to apply the utility behaviour to some breakpoints. As a mobile-first library, any applying to smaller breakpoints will also modify larger ones unless another class overrides this behaviour.
- blank - leave blank to apply
marginorpaddingto all breakpoints. sm- use to applymarginorpaddingto sm and larger breakpoints.md- use to applymarginorpaddingto md and larger breakpoints.lg- use to applymarginorpaddingto lg and larger breakpoints.xl- use to applymarginorpaddingto xl breakpoints.
{size} #
0- use to eliminate existingmarginorpaddingand set to01- use to setmarginorpaddingto$base-unit2- use to setmarginorpaddingto$base-unit * 23- use to setmarginorpaddingto$base-unit * 34- use to setmarginorpaddingto$base-unit * 45- use to setmarginorpaddingto$base-unit * 56- use to setmarginorpaddingto$base-unit * 67- use to setmarginorpaddingto$base-unit * 78- use to setmarginorpaddingto$base-unit * 89- use to setmarginorpaddingto$base-unit * 910- use to setmarginorpaddingto$base-unit * 10auto- use to setmargintoautovalue
Examples #
Margins #
In this example, various margin classes have been applied to render margin on all 4 sides of the blue squares. The margin can be visualized in blue.
Side Margins #
Apply margin to specific sides of an element by adding t, b, l, r, x or y to the class name.
Padding #
In this example, various padding classes have been applied to render padding on all 4 sides of the blue squares. The padding can be visualized in yellow.
Side Paddings #
Apply padding to specific sides of an element by adding t, b, l, r, x or y to the class name.