mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
41 lines
996 B
SCSS
41 lines
996 B
SCSS
// ==========================================================================
|
|
// Settings / Config / Spacers
|
|
// ==========================================================================
|
|
|
|
// Spacers
|
|
// ==========================================================================
|
|
|
|
$spacers: (
|
|
'gutter': var(--grid-gutter),
|
|
'gutter-2x': calc(2 * var(--grid-gutter)),
|
|
'xs': #{vh(5)},
|
|
'sm': #{vh(7.5)},
|
|
'md': #{vh(10)},
|
|
'lg': #{vh(12.5)},
|
|
'xl': #{vh(15)},
|
|
);
|
|
|
|
// Function
|
|
// ==========================================================================
|
|
|
|
// Returns spacer.
|
|
//
|
|
// ```scss
|
|
// .c-box {
|
|
// margin-top: spacer(gutter);
|
|
// }
|
|
// ```
|
|
//
|
|
// @param {string} $key - The spacer key in $spacers.
|
|
// @return {size}
|
|
|
|
@function spacer($spacer) {
|
|
@if not map-has-key($spacers, $spacer) {
|
|
@error "Unknown master spacer: #{$spacer}";
|
|
}
|
|
|
|
$index: map-get($spacers, $spacer);
|
|
|
|
@return $index;
|
|
}
|