Skip to content

Layout

Layout mixins for positioning and overflow management.

fullscreen()

Creates a fullscreen element with customizable positioning.

ParameterTypeDefault ValueDescription
$positionstringabsoluteThe position value
$topnumber0The top value
$rightnumber0The right value
$bottomnumber0The bottom value
$leftnumber0The left value
$var-prefixstring"fullscreen"The CSS variable prefix
scss
.overlay {
    @include fullscreen();
}
css
.overlay {
    position: var(--fullscreen-position, absolute);
    top: var(--fullscreen-top, 0);
    right: var(--fullscreen-right, 0);
    bottom: var(--fullscreen-bottom, 0);
    left: var(--fullscreen-left, 0);
}

center-viewport()

Centers an element horizontally in the viewport.

ParameterTypeDefault ValueDescription
$widthnumber100vwThe width of the element
scss
.modal {
    @include center-viewport(500px);
}
css
.modal {
    left: calc(50% - 500px);
    width: 500px;
}

clearfix()

Clears floated elements within a container.

scss
.container {
    @include clearfix();
}
css
.container:after {
    content: "";
    display: block;
    height: 1px;
    clear: both;
}

hide-scrollbar()

Hides scrollbars while maintaining scroll functionality.

scss
.scrollable {
    @include hide-scrollbar();
}
css
.scrollable {
    scrollbar-width: none;
    scrollbar-height: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.scrollable::-webkit-scrollbar {
    width: 0;
    height: 0;
    background-color: transparent;
}

overflow()

Creates scrollable overflow with hidden scrollbars.

ParameterTypeDefault ValueDescription
$orientationstring"vertical"The overflow direction (horizontal, vertical, both)
scss
.content {
    @include overflow(vertical);
}
css
.content {
    overflow-y: auto;
    scrollbar-width: none;
    scrollbar-height: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.content::-webkit-scrollbar {
    width: 0;
    height: 0;
    background-color: transparent;
}

min-aspect-ratio()

Creates an element that maintains a minimum aspect ratio using the padding-bottom hack.

ParameterTypeDefault ValueDescription
$minnumber1The minimum aspect ratio (width/height)
scss
.image-container {
    @include min-aspect-ratio(16/9);
}
css
.image-container:before {
    content: "";
    float: left;
    padding-bottom: var(--min-aspect-ratio, 177.7777777778%);
}
.image-container:after {
    content: "";
    display: table;
    clear: both;
}