Reference

Layout patterns and CSS variables for scrollytelling stories.

Page Layout

The .page class provides a centered, width-constrained container for standard content pages. It's typically used with Nav and Footer components.

body flex-direction: column; min-height: 100dvh
5%
<Nav />
5%
main flex: 1
5%
.page
max-width: 1200px
padding-top: 5.5rem

Centered content...

margin-bottom: 7.5rem
5%
<script>
  import { Nav, Footer } from '@the-vcsi/scrolly-kit';
</script>

<Nav />

<article class="page">
  <h1>Page Title</h1>
  <p>Content goes here...</p>
</article>

<Footer />

CSS Variables

Nav, Footer, and .page all use the same width/padding variables for consistent alignment:

VariableDefaultDescription
--vcsi-page-max-width1200pxMaximum content width (shared by Nav, Footer, .page)
--vcsi-page-inline-padding5%Side padding (shared by Nav, Footer, .page)
--vcsi-nav-height4.5remNav height (.page has padding-top to clear it)
--vcsi-bottom-padding7.5remBottom padding for pages and stories

When to Use

  • .page — Standard content pages (docs, about, home)
  • .story — Scrollytelling articles with layouts that break out

Story Container

The .story class is the main container for scrollytelling content. It provides:

  • Centered prose by default (max-width 600px)
  • Light theme isolation from global dark mode
  • Padding and spacing for readability
.story
padding-top: 5.5rem
Centered prose (600px)

Title & intro text...

Layout (breaks prose, keeps padding)

More prose content...

--vcsi-bottom-padding (7.5rem)
<article class="story">
  <h1>Story Title</h1>
  <p>Centered prose content...</p>

  <section class="split-layout">
    <!-- Layout breaks out to full width -->
  </section>

  <p>Back to centered prose...</p>
</article>

CSS Variables

VariableDefault (Light)Default (Dark)Description
--vcsi-story-bg#f4efea#353839Story background color
--vcsi-story-fgrgb(55, 55, 55)whiteStory text color
--vcsi-story-max-width600pxMax width for prose content

Dark Theme

Add data-theme="dark" for dark stories:

<article class="story" data-theme="dark">
  <!-- Dark background, light text -->
</article>

Split Layout

Two-column layout with a sticky visualization panel and scrolling content. While it breaks out of the prose max-width, it maintains its own side padding (2rem by default) rather than going edge-to-edge like .fullscreen-layout.

.story
padding-top: 5.5rem
Centered prose (600px)

Title & intro text...

1fr (remaining) minmax(450px, 45%)
scrolly-content
spacer
Step 1
Step 2
Step 3
spacer
2rem gap
sticky-panel
Visualization

More prose content...

padding-bottom: 7.5rem
<section class="split-layout">
  <div class="sticky-panel">
    <!-- Your visualization component -->
  </div>
  <div class="scrolly-content">
    <!-- ScrollyContent or custom steps -->
  </div>
</section>

<!-- Reversed: panel on left -->
<section class="split-layout reversed">
  ...
</section>

CSS Variables

VariableDefaultDescription
--vcsi-panel-width45%Width of sticky panel
--vcsi-panel-min-width450pxMinimum panel width
--vcsi-panel-heightmin(80vh, 600px)Panel height
--vcsi-panel-top-offsetauto-centeredVertical position of sticky panel
--vcsi-layout-gap2remGap between columns
--vcsi-content-padding-inline2remHorizontal padding for the layout
--step-height90vhVertical space between steps
--spacer-height65vhHeight of top/bottom spacers

Mobile Behavior

On screens <768px, the layout stacks with the sticky panel as a full-screen background and content overlaying it.

Cookbook

Customizing Panel Size

To give the visualization more space while capping its absolute width:

1fr (remaining) minmax(400px, 60%)
scrolly-content
Steps...
2rem
sticky-panel
max-width: 700px
Visualization (larger)
.split-layout { --vcsi-panel-width: 60%; --vcsi-panel-min-width: 400px; } .sticky-panel { max-width: 700px; }

The grid uses minmax(min-width, width), so the panel scales between the min and percentage values. Adding max-width on .sticky-panel caps the absolute size on wide screens.

Fullscreen Layout

Full-viewport immersive layout for dramatic visualizations.

100vw (edge-to-edge)
sticky-panel (100vh)
Full-screen Visualization
max-width: 500px
Step (overlaid)
margin-left: calc(-50vw + 50%) breaks out of container
<section class="fullscreen-layout">
  <div class="sticky-panel">
    <!-- Full-viewport visualization -->
  </div>
  <div class="scrolly-content">
    <!-- Overlaid step boxes -->
  </div>
</section>

CSS Variables

VariableDefaultDescription
--vcsi-step-max-width500pxMax width of step boxes
--vcsi-step-padding2remPadding inside steps
--vcsi-step-pointer-eventsnoneAllows clicks to pass through to panel

Cookbook

Repositioning Step Boxes

By default, step boxes are horizontally centered via margin: 0 auto on .scrolly-content. Override to position them differently:

Step
Left
Step
Center (default)
Repositioning step boxes (CSS)
/* Left-aligned steps */ .fullscreen-layout .scrolly-content { margin-left: 2rem; margin-right: auto; }

The margin-left: auto / margin-right: auto pattern pushes the content to the opposite side. Add a fixed margin on the aligned side for padding from the edge.

Examples in the Wild

Inspiring fullscreen scrollytelling stories from around the web.

Dashboard Layout

Sidebar + main content for interactive data dashboards.

sidebar
Controls
main
Chart / Visualization
<article class="dashboard-layout">
  <aside class="dashboard-sidebar">
    <button class="sidebar-toggle">...</button>
    <div class="sidebar-content">
      <!-- Filters, controls -->
    </div>
  </aside>
  <main class="dashboard-main">
    <!-- Visualization -->
  </main>
</article>

CSS Variables

VariableDefaultDescription
--vcsi-sidebar-width280pxSidebar width when open
--vcsi-sidebar-collapsed-width48pxSidebar width when collapsed
--vcsi-sidebar-bg#ebe6e1Sidebar background
--vcsi-sidebar-transition300ms easeAnimation timing for collapse/expand
--vcsi-z-overlay1000Z-index for mobile overlay

Collapsible Sidebar

Toggle .sidebar-collapsed class on .dashboard-layout to collapse/expand.

Mobile Behavior

On mobile, sidebar becomes a slide-down drawer. Toggle .sidebar-open class to show.

Step Styling

Step boxes in scrolly layouts use these CSS variables for colors and sizing. These apply to both .split-layout and .fullscreen-layout.

Light Theme
Active Step
Inactive Step
Dark Theme
Active Step
Inactive Step

CSS Variables

VariableLightDarkDescription
--story-step-bg#fff#2a2a2aActive step background
--story-step-fg#333#e8e8e8Active step text color
--story-step-bg-inactive#f5f5f5#222Inactive step background
--story-step-fg-inactive#ccc#666Inactive step text color
--step-box-shadow1px 1px 10px rgba(0,0,0,0.2)Step box shadow
--step-max-width600pxMaximum width of step box
--step-padding1remPadding inside step box
--step-border-radius5pxStep box corner radius
--step-text-aligncenterText alignment in steps

--story-step-* variables control colors and are typically set globally in app.css for consistent theming across your story. --step-* variables control layout and can be set per-section for local customization.

Example Override

Custom step colors
.split-layout { --story-step-bg: #154734; --story-step-fg: #fff; }

For a minimal look where only text floats over the visualization:

Minimal floating text
.split-layout { --story-step-bg: transparent; --story-step-bg-inactive: transparent; --step-box-shadow: none; }

Global CSS Variables

Design tokens available throughout your project. See tokens.css for the full source.

Colors

VariableValueDescription
--vcsi-color-accent#154734Brand accent (UVM Green)
--vcsi-color-uvm-green#154734UVM Green
--vcsi-color-uvm-goldrgb(255, 209, 0)UVM Gold
--vcsi-color-beige#f4efeaWarm beige
--vcsi-gray-100 to 900scaleGray scale (100, 200, 300, 400, 600, 700, 800, 900)

Semantic Colors (auto-switch with dark mode)

VariableDescription
--vcsi-bgBackground color
--vcsi-fgText color
--vcsi-borderBorder color
--vcsi-hoverHover state
--vcsi-linkLink color
--vcsi-mutedMuted/secondary text
--vcsi-code-bgCode block background
--vcsi-code-fgCode text color

Typography

VariableDefault
--vcsi-font-sans"Atlas Grotesk", system-ui, sans-serif
--vcsi-font-serif"Baskerville", Georgia, serif
--vcsi-font-mono"Atlas Typewriter", "SF Mono", monospace
--vcsi-font-headingvar(--vcsi-font-serif)

Font Sizes (responsive clamp)

VariableRange
--vcsi-font-size-giant3rem → 4rem
--vcsi-font-size-xl1.8rem → 3rem
--vcsi-font-size-lg1.5rem → 2.5rem
--vcsi-font-size-md1.25rem → 1.75rem
--vcsi-font-size-base1.125rem → 1.25rem
--vcsi-font-size-small1rem → 1.125rem
--vcsi-font-size-xs0.875rem → 1rem

Font Weights & Line Heights

VariableValue
--vcsi-font-weight-light300
--vcsi-font-weight-regular400
--vcsi-font-weight-medium500
--vcsi-font-weight-semibold600
--vcsi-font-weight-bold700
--vcsi-line-height-tight1.17 (headings)
--vcsi-line-height-snug1.33 (subheadings)
--vcsi-line-height-normal1.5 (body)
--vcsi-line-height-relaxed1.6 (long-form)

Spacing

VariableValue
--vcsi-space-xs0.25rem
--vcsi-space-sm0.5rem
--vcsi-space-md1rem
--vcsi-space-lg1.5rem
--vcsi-space-xl2rem
--vcsi-space-2xl3rem

Border Radius

VariableValue
--vcsi-radius-sm3px
--vcsi-radius-md6px
--vcsi-radius-lg8px
--vcsi-radius-full9999px

Transitions

VariableValue
--vcsi-transition-fast150ms ease
--vcsi-transition-base200ms ease
--vcsi-transition-slow300ms ease