Effects

Fluid Margin

Utilities for sets min and max margins for screen size without breakpoints.


Variant

Active Checked Child-Selection Dark Mode Disabled Expand First-Last-Selection First-Letter Focus Focus-Visible Focus-Within Fullscreen Group-Focus Group-Hover Hover Landscape Light Mode Portrait Reduce-Motion Responsive Selection-Hover Visited

API

classcss
fluid m-min-{value} m-max-{value}@media screen and (min-width: 20rem) { .fluid.m-min-{modifier}.m-max-{modifier} { margin: calc({min} + 0 * ((100vw - 20rem) / 30)) } } @media screen and (min-width: 50rem) { .fluid.m-min-{modifier}.m-max-{modifier} { margin: {max} } }
valuemodifier
00
10.25rem
20.5rem
30.75rem
41rem
51.25rem
61.5rem
82rem
102.5rem
123rem
164rem
205rem
246rem
328rem
4010rem
4812rem
5614rem
6416rem
7218rem
8020rem
8822rem
9624rem
10426rem
11228rem

Usage

Set margin spacing adaptively to the width of the screen size. When the smaller screen size, the margin is margin-10 at min. Meanwhile, when the screen size is getting bigger, the margin is margin-4 at max.

<div class="fluid margin-min-10 margin-max-4">
...
</div>
HTML
.dummy {
@extend
.fluid,
.margin-min-10,
.margin-max-4;
}
SCSS

Mix with other fluid utilities, such as Fluid Font Size, Fluid Padding.

<div class="fluid margin-min-4 margin-max-2 padding-min-8 padding-max-4 text-min-lg text-max-md">
...
</div>
HTML
.dummy {
@extend
.fluid,
.margin-min-4,
.margin-max-2,
.padding-min-8,
.padding-max-4,
.text-min-lg,
.text-max-md;
}
SCSS