Overscroll
Overscroll utility class styles with module mixins for responsive modifiers.
Utilities (anchor)
Utility name | Property values |
---|---|
.overscroll-auto | overscroll-behavior: auto |
.overscroll-contain | overscroll-behavior: contain |
.overscroll-initial | overscroll-behavior: initial |
Responsive mixins (anchor)
Responsive modifier mixins are provided to include where required in custom breakpoints, the utilities available use the following modifier class naming convention:
.overscroll-auto
.overscroll-auto-xxl
.overscroll-auto-xl
.overscroll-auto-lg
.overscroll-auto-md
.overscroll-auto-sm
.overscroll-auto-xs
.overscroll-auto-xxs
Using the module (anchor)
Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.
@use "stylemods/scss" as *;
@include overscroll-css;
// Example breakpoint
@media (width <= 480px) {
@include overscroll-sm-css;
}
See the using modules page for more information including how to compile the modules in cascade layers and include and reuse them in multiple source files.
Using the framework (anchor)
Using the recommended custom setup enable the styles (and required breakpoints) in an overrides document:
@use "stylemods/scss/configuration" as *;
$enable-overscroll: true;
$enable-overscroll-sm: true;
Include the overrides and the framework styles with your custom document for compiling the framework:
@use "overrides";
@use "stylemods/scss/stylemods";
See using the framework for more information including how the styles can also be compiled within cascade layers.
Source code (anchor)
The modules and framework use the same source code, see Sass maps to learn how to customize the values below.
overscroll.scss
// ------------------------------------------------------------
// Overscroll behavior
// ------------------------------------------------------------
$overscroll-values: (
"overscroll-auto": auto,
"overscroll-contain": contain,
"overscroll-initial": initial,
) !default;
@mixin overscroll-css {
@each $name, $value in $overscroll-values {
.#{$name} {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint XXL
@mixin overscroll-xxl-css {
@each $name, $value in $overscroll-values {
.#{$name}-xxl {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint XL
@mixin overscroll-xl-css {
@each $name, $value in $overscroll-values {
.#{$name}-xl {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint LG
@mixin overscroll-lg-css {
@each $name, $value in $overscroll-values {
.#{$name}-lg {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint MD
@mixin overscroll-md-css {
@each $name, $value in $overscroll-values {
.#{$name}-md {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint SM
@mixin overscroll-sm-css {
@each $name, $value in $overscroll-values {
.#{$name}-sm {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint XS
@mixin overscroll-xs-css {
@each $name, $value in $overscroll-values {
.#{$name}-xs {
overscroll-behavior: #{$value};
}
}
}
// Breakpoint XXS
@mixin overscroll-xxs-css {
@each $name, $value in $overscroll-values {
.#{$name}-xxs {
overscroll-behavior: #{$value};
}
}
}