Skip to content

Search

Start typing to search.


Show all pages

Documentation

layout

Scroll area

A scrollable region with custom scrollbars, rendered by the included behavior script.

UpdatedCSS onlyPlain classes; no JavaScript in any stack.

Usage

Load dist/ca-scroll-area.js; it renders a scrollbar per overflowing axis and keeps the thumb, the data-* state and the fade variables in sync while the viewport scrolls natively.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Driving lesson — Friday 16:00
  • Intake — Saturday 10:00
  • Theory lesson — Saturday 13:00
HTML

Examples

Fade and gutter

--fade masks edges that still hide content; --gutter reserves room so content does not slide under the scrollbar.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
HTML

Guidance and accessibility

When to use

  • Use a scroll area where a visible native scrollbar disturbs the layout: long pick lists, side panels, code or log viewers.
  • The markup stays plain, a __viewport around __content. The viewport scrolls natively (wheel, touch and arrow keys) and the core hides the native bar; dist/ca-scroll-area.js renders the __scrollbar, __thumb and __corner parts. It is Calaca’s own framework-free implementation, so no external library is needed.
  • The script owns placement and the data-* state (data-orientation, data-hovering, data-scrolling, data-has-overflow-*) plus the --scroll-area-overflow-* variables --fade reads; the contract owns the look and the interaction states.
  • Without the script the parts simply stay absent: the region still scrolls, but shows no custom scrollbar.

Accessibility

  • The viewport is focusable (tabindex="0") so keyboard users can scroll it with arrow keys.
  • Scrollbars stay real interactive parts: drag the thumb, or click the track to page.
  • The fade-in honors reduced motion through the skin’s motion-safe utilities.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the scroll-area component
ClassKindUse it for
ca-scroll-areaComponentThe frame; clips the content and anchors the scrollbar parts.
ca-scroll-area__viewportPartThe scrolling box; takes keyboard focus for arrow-key scrolling.
ca-scroll-area__contentPartThe content wrapper inside the viewport.
ca-scroll-area__scrollbarPartA scrollbar on one axis, rendered by the script while that axis overflows; it fades in while hovering or scrolling.
ca-scroll-area__thumbPartThe draggable thumb inside a scrollbar.
ca-scroll-area__cornerPartThe square where horizontal and vertical scrollbars meet.
ca-scroll-area--fadeVariantMasks edges that still have scrollable content; the script keeps --scroll-area-overflow-* updated.
ca-scroll-area--gutterVariantReserves room for the scrollbar so content does not sit underneath it.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Driving lesson — Friday 16:00
  • Intake — Saturday 10:00
  • Theory lesson — Saturday 13:00

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Driving lesson — Friday 16:00
  • Intake — Saturday 10:00
  • Theory lesson — Saturday 13:00

Bloque skin

Example skin pushed far from base: square, heavy, offset shadows, larger targets.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Driving lesson — Friday 16:00
  • Intake — Saturday 10:00
  • Theory lesson — Saturday 13:00

Pliego skin

Example skin from the press sheet: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

  • Intake — Monday 09:00
  • Theory lesson — Monday 11:00
  • Driving lesson — Tuesday 14:00
  • Driving lesson — Wednesday 09:30
  • Theory exam prep — Thursday 10:00
  • Driving lesson — Thursday 15:30
  • Mock exam — Friday 13:00
  • Driving lesson — Friday 16:00
  • Intake — Saturday 10:00
  • Theory lesson — Saturday 13:00

Framework notes

Link the prebuilt stylesheet of your skin next to your brand stylesheet. No build step.

HTML
<link rel="stylesheet" href="brand.css" />
<link rel="stylesheet" href="ca-base.css" />