Skip to content

Visuals

Visual mixins for images, shapes, and gradients.

object-fit()

Applies object-fit and object-position properties.

ParameterTypeDefault ValueDescription
$fitstringcoverThe object-fit value (cover, contain, fill, none, scale-down)
$positionstring50% 50%The object-position value
$var-prefixstring"obj"The CSS variable prefix
scss
.image {
    @include object-fit(cover, center);
}
css
.image {
    width: var(--obj-width, 100%);
    height: var(--obj-height, 100%);
    object-fit: var(--obj-object-fit, cover);
    object-position: var(--obj-object-position, center);
}

triangle()

Creates CSS triangles using borders.

ParameterTypeDefault ValueDescription
$directionstring-The triangle direction (up, right, down, left)
$triangle-widthnumber-The width of the triangle
$triangle-heightnumber-The height of the triangle
$triangle-colorcolor-The color of the triangle
scss
.arrow {
    @include triangle(up, 20px, 10px, #333);
}
css
.arrow {
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-color: transparent transparent #333;
    border-width: 0 10px 10px;
}

linear-gradient()

Creates linear gradients with fallback colors.

ParameterTypeDefault ValueDescription
$directionstring-The gradient direction
$color-stopslist-The color stops for the gradient
scss
.element {
    @include linear-gradient(to right, #ff0000, #00ff00);
}
css
.element {
    background: #ff0000;
    background: linear-gradient(to right, #ff0000, #00ff00);
}

overflow-shadows()

Adds shadows to indicate scrollable content with fade effects.

scss
.scrollable-content {
    @include overflow-shadows();
}
css
.scrollable-content {
    position: relative;
}
.scrollable-content:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), transparent);
    pointer-events: none;
    z-index: 1;
    opacity: var(--overflow-shadow-before-opacity, 1);
}
.scrollable-content:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
    pointer-events: none;
    z-index: 1;
    opacity: var(--overflow-shadow-after-opacity, 1);
}