Scrollbar
Scrollbar
Use scrollbar for a themed native scrollbar or scrollbar scrollbar-thin for a compact one.
<ul class="scrollbar scrollbar-thin max-h-28 w-full overflow-y-auto rounded-md border p-3 text-sm leading-7" tabindex="0" aria-label="Project files">
<li>README.md</li>
<li>package.json</li>
<li>index.html</li>
<li>main.js</li>
<li>styles.css</li>
<li>LICENSE</li>
</ul>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
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.