Skip to content

A11y

Accessibility mixins for better user experience.

accessible-item()

Hides an element visually but keeps it accessible to screen readers.

scss
.element {
    @include accessible-item();
}
css
.element {
    position: absolute;
    width: 1px;
    height: 1px;
    white-space: nowrap;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

unselectable()

Prevents an element to be selected.

ParameterTypeDefault ValueDescription
$boolbooleantrueIf true, disables selection and pointer events; if false, enables them
scss
.button {
    @include unselectable();
}
css
.button {
    pointer-events: none;
    user-select: none;
}