Helper classes that give top/bottom margin to your element to add vertical spacing.
All classes are defined in format h-margin-[top|bottom]-[$size]
.
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xxxxs sg-box">h-margin-top-xxxxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xxxxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xxxs sg-box">h-margin-top-xxxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xxxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xxs sg-box">h-margin-top-xxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xs sg-box">h-margin-top-xs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-sm sg-box">h-margin-top-sm</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-sm"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-md sg-box">h-margin-top-md</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-md"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-lg sg-box">h-margin-top-lg</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-lg"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xl sg-box">h-margin-top-xl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xxl sg-box">h-margin-top-xxl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xxl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-top-xxxl sg-box">h-margin-top-xxxl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-top-xxxl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xxxxs sg-box">h-margin-bottom-xxxxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xxxxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xxxs sg-box">h-margin-bottom-xxxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xxxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xxs sg-box">h-margin-bottom-xxs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xxs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xs sg-box">h-margin-bottom-xs</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xs"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-sm sg-box">h-margin-bottom-sm</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-sm"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-md sg-box">h-margin-bottom-md</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-md"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-lg sg-box">h-margin-bottom-lg</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-lg"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xl sg-box">h-margin-bottom-xl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xxl sg-box">h-margin-bottom-xxl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xxl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';
<div class="sg-box sg-box--dark"></div>
<div class="h-margin-bottom-xxxl sg-box">h-margin-bottom-xxxl</div>
<div class="sg-box sg-box--dark"></div>
<div class="sg-box sg-box--dark"></div>
<div class="{{ class }} sg-box">{{ class }}</div>
<div class="sg-box sg-box--dark"></div>
{
"language": "en-US",
"class": "h-margin-bottom-xxxl"
}
$definitions: (
'xxxxs': (
'xs': 4px,
),
'xxxs': (
'xs': 8px,
),
'xxs': (
'xs': 16px,
),
'xs': (
'xs': 16px,
'lg': 24px
),
'sm': (
'xs': 24px,
'lg': 32px
),
'md': (
'xs': 32px,
'lg': 48px
),
'lg': (
'xs': 32px,
'lg': 56px
),
'xl': (
'xs': 48px,
'lg': 72px
),
'xxl': (
'xs': 72px,
'lg': 120px
),
'xxxl': (
'xs': 120px,
'lg': 192px
),
);
@each $size, $spacings in $definitions {
.h-margin-top-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-top: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-top: $spacing;
}
}
}
}
.h-margin-bottom-#{$size} {
@each $break, $spacing in $spacings {
@if $break == 'xs' {
margin-bottom: $spacing;
}
@else {
@include bp(#{$break}-min) {
margin-bottom: $spacing;
}
}
}
}
}
import './vertical-spacing.scss';