Scrollbar

Scrollbar gutter and width utility styles with module mixins for responsive modifiers.

Utilities (anchor)

Scrollbar utilities and property values
Utility class Property values
.scroll-gutter-auto scrollbar-gutter: auto
.scroll-gutter-stable scrollbar-gutter: stable
.scroll-gutter-stable-edges scrollbar-gutter: stable both-edges
.scroll-gutter-initial scrollbar-gutter: initial
.scroll-width-auto scrollbar-width: auto
.scroll-width-thin scrollbar-width: thin
.scroll-width-initial scrollbar-width: 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:

.scrollbar-stable-auto
.scrollbar-stable-auto-xxl
.scrollbar-stable-auto-xl
.scrollbar-stable-auto-lg
.scrollbar-stable-auto-md
.scrollbar-stable-auto-sm
.scrollbar-stable-auto-xs
.scrollbar-stable-auto-xxs

Using the module (anchor)

To use the module load the StyleMods scss directory as follows (changing the path to suit the source files location as required) then include the Sass mixin anywhere below.

custom.scss
@use "stylemods/scss" as *;
@include scrollbar-css;

// Example breakpoint
@media (max-width: 480px) {
  @include scrollbar-sm-css;
}

Source code (anchor)

scrollbar.scss
//  ------------------------------------------------------------
//  Scrollbar
//  ------------------------------------------------------------
$scrollbar-gutter: (
  "stable": stable,
  "stable-edges": stable both-edges,
  "auto": auto,
  "initial": initial,
) !default;

$scrollbar-width: (
  "auto": auto,
  "thin": thin,
  "initial": initial,
) !default;

@mixin scrollbar-gutter-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name} {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name} {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint XXL
@mixin scrollbar-gutter-xxl-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-xxl {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-xxl-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-xxl {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint XL
@mixin scrollbar-gutter-xl-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-xl {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-xl-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-xl {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint LG
@mixin scrollbar-gutter-lg-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-lg {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-lg-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-lg {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint MD
@mixin scrollbar-gutter-md-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-md {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-md-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-md {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint SM
@mixin scrollbar-gutter-sm-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-sm {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-sm-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-sm {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint XS
@mixin scrollbar-gutter-xs-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-xs {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-xs-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-xs {
      scrollbar-width: #{$value};
    }
  }
}

// Breakpoint XXS
@mixin scrollbar-gutter-xxs-css {
  @each $name, $value in $scrollbar-gutter {
    .scroll-gutter-#{$name}-xxs {
      scrollbar-gutter: #{$value};
    }
  }
}

@mixin scrollbar-width-xxs-css {
  @each $name, $value in $scrollbar-width {
    .scroll-width-#{$name}-xxs {
      scrollbar-width: #{$value};
    }
  }
}