Scrollbar

Use scrollbar for a themed native scrollbar or scrollbar scrollbar-thin for a compact one.

  • README.md
  • package.json
  • index.html
  • main.js
  • styles.css
  • LICENSE

Usage

Set a height or width constraint and enable overflow on the same element as the scrollbar class.

<pre class="scrollbar max-h-48 overflow-auto" tabindex="0" aria-label="Build output"><code>Build finished in 1.2 seconds.</code></pre>

When upgrading from 1.1, replace scrollbar-sm with scrollbar scrollbar-thin in markup and @apply rules.

@import "tailwindcss";
@import "basecoat-css/vega.css";

.file-list {
  @apply scrollbar scrollbar-thin max-h-28 overflow-y-auto;
}

Scrollbar visibility follows browser and operating system preferences. For horizontal scrolling and RTL examples, see Scroll Area.

Where Basecoat uses it

ClassUsed on
scrollbarCode Block and Trace output, scrollable Dialog and Sheet content, and the Carousel fallback
scrollbar scrollbar-thinCompact lists in Select, Combobox, and Sidebar
Either sizeNative Scroll Area viewports

Customization

--scrollbar-thumb and --scrollbar-track control the colors. Browsers that use WebKit scrollbar styling also use --scrollbar-width, --scrollbar-sm-width, and --scrollbar-radius. Browsers using native scrollbar sizing choose the thickness for auto and thin.