Skip to content

Section band

A full-width band of its own color that sets one section apart, straight or slanted.

<section class="cap-section-band" id="sb-straight" aria-label="Straight band">
  <p class="band-demo">1,200 manuscripts edited last year.</p>
</section>

Installation

// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/section-band.css";

Usage

<section class="cap-section-band" data-cut="slant" data-overlap aria-label="Our work in numbers">
  <div class="cap-page">...</div>
</section>

Examples

Slanted over its neighbors

<div class="band-demo-page">
  <div class="band-demo-before">The section before</div>
  <section class="cap-section-band" data-cut="slant" data-overlap id="sb-slant" aria-label="Slanted band">
    <p class="band-demo">Trusted by researchers at Example University and Example Institute.</p>
  </section>
  <div class="band-demo-after">The section after</div>
</div>

API reference

SectionBand

PropTypeRequiredDoes
childrenReactNodeYes
cut"slant""slant": diagonal top and bottom edges with a translucent wedge along each.
overlapbooleanPull the band over its neighbors by the slant's depth.
idstring
labelstring

CSS variables

VariableDefault
--cap-band-bgvar(--accent-12)
--cap-band-fall5.5rem
--cap-band-ghostcolor-mix(in srgb, var(--cap-band-bg, var(--accent-12)) 50%, transparent)
--cap-band-pad-bottomcalc(var(--cap-band-fall) + var(--space-6))
--cap-band-pad-topcalc(var(--cap-band-rise) + var(--space-6))
--cap-band-rise6rem
--cap-band-step2.5rem
--cap-band-textvar(--accent-1)

Parts and data attributes

ClassIs
.cap-section-bandthe root
AttributeValues
data-cutslant
data-overlappresent or absent

Accessibility

Nothing to operate; its content is in reading order.

  • The band's text color must reach 4.5:1 on --cap-band-bg; the default pair (--accent-1 on --accent-12) is in the contrast report, and a site that sets its own band checks its pair.
  • Forced colors: the band draws a rule at its top and bottom, since its color is gone.