Section backgrounds, icons, anchors and remote video
Status: approved 2026-11-20 (Kevin) as the second part of the first batch of general gaps found by comparing Spillway with large university sites (the first part is Carousel, Accordion and Tabs). Four additions to the core blocks: a background image or video on Section, a bundled icon set, link names on headings and sections with an On this page block, and YouTube and Vimeo in the Video block. Everything renders on the server, works without script and follows the visitor's motion and consent choices.
Section background image and video
- Background image: a media library image behind the section's blocks, as a responsive picture (WebP
srcset, the original format as fallback, real dimensions) cropped around the image's focal point, loaded lazily unless the section opens the page. - Overlay: a color from the brand (Dark is the brand's text color, Light its page background, Primary, Secondary) laid over the image at a strength of 20 to 80 percent, so text stays readable on any photo.
- Text color: Automatic (light text on Dark, Primary and Secondary overlays, dark text on Light), or Light or Dark chosen by hand. The blocks inside (headings, text, buttons, cards) switch with it the way they do on the colored backgrounds.
- Background video: a muted, looping .mp4 or .webm with the background image as its poster, under the same rules as the Hero's: no
autoplayin the markup, the page's motion script plays it only when the brand's motion is on, the visitor has not asked for reduced motion (device setting or the Reduce motion switch) and Save-Data is off, pauses it off screen, and shows a Pause background video button. Everyone else sees the poster. - Parallax: Section joins Hero as a block whose background the Parallax background scroll effect moves.
- Contrast in the page checks: a section with a background image gets a contrast check for its text color over the overlay. The image's pixels are unknown, so the check takes the worst case (a white image under light text, a black one under dark text) and warns below 4.5:1, naming the strength that would pass. No overlay with a background image is a warning too.
Icons
- The set: a curated selection of about a hundred icons from Lucide (ISC license, with the icons derived from Feather under MIT), chosen for institutional and marketing sites (people, places, study, research, health, transport, money, help, social actions, arrows). Only these ship: they are compiled into the block library as one map of shapes (
packages/blocks/src/icons-data.ts, generated bypackages/blocks/scripts/build-icons.mjsfrom alucide-staticpackage), recorded inTHIRD_PARTY_NOTICES.md. - Rendering: an icon is an inline SVG with
currentColor, so it takes the text color of where it sits and needs no request, sprite file or script; the page builder, islands, headless renders and front ends that render blocks themselves all show it the same way. - Accessibility: an icon is decorative (
aria-hidden="true", not focusable) unless the block gives it a label, when it becomesrole="img"with that label. - Where: Cards (an icon above each card's title, with an optional label), Button and Buttons (an icon before or after the label; always decorative, the label names the button), and Stats (an icon above each figure, with an optional label). Menu items are left out for now: the menu model and the site header are being changed in another piece of work.
- The picker: in the page builder an Icon field is a searchable grid of the icons with their names (the stored value is the icon's name, such as
graduation-cap); the AI and the API see it as a choice of names.
Anchors and On this page
- Link name on Heading and Section: an optional name (
admissions,visiting-campus) that becomes the element'sid, so/page#admissionsjumps to it. Names are lowercased into letters, digits and hyphens. On one page every link name must be unique, including the Accordion items' and tabs' link names: a duplicate is an error in the page checks, and the page still renders with the second one numbered (admissions-2) so the HTML stays valid. - On this page (a new block in Layout): a list of jump links to the page's headings. Levels: H2 only (default), H2 and H3, or H2 to H4. Title (default "On this page"). Sticky: off, or the list stays in view while the page scrolls, for a sidebar column or a sidebar placement (Structure → Placements). It is a
navnamed by its title, with a nested list that follows the heading levels. The server fills it from the page's own Heading blocks (slots included); a heading without a link name gets one from its text, so every listed heading has a target. In the page builder it shows a note that the list fills in on the page. - Smooth scrolling on pages with the block, only when the visitor has not asked for reduced motion (device setting or the Reduce motion switch); otherwise jumps are instant. Headings with an
idkeep a scroll margin so a jump does not hide them under a sticky header.
YouTube and Vimeo in Video
- Source: the Video block's file field also takes a YouTube address (
youtube.com/watch?v=,youtu.be/,/shorts/,/embed/) or a Vimeo address (vimeo.com/<id>, with the hash of an unlisted video, orplayer.vimeo.com/video/<id>); a start time (t=orstart=) is kept. - Facade: the page shows a poster with a play button and loads nothing from YouTube or Vimeo until the visitor presses it. The poster is the block's own Poster image when set, else the video's thumbnail, which the server fetches once through the outbound fetch guard (SSRF checks, timeout, size limit), re-encodes and keeps in its data folder, and serves from the site at
/_video-thumbs/<provider>/<id>.jpg. A failed fetch leaves a neutral poster with the title and is retried later. - The player: on press the facade becomes the privacy-friendly player in a sandboxed frame:
www.youtube-nocookie.com/embed/<id>orplayer.vimeo.com/video/<id>?dnt=1, starting to play. Without script the facade is a link to the video on its site. Both player hosts are allowed in the page'sframe-srcwhatever the site's embed hosts list says. - Lightbox: Open in a lightbox plays the video in the Gallery's lightbox (the browser's popover: Escape and Close work without script) instead of in place; closing it removes the frame, which stops the video.
- Consent: with the consent banner on, the facade says that the video is hosted by YouTube or Vimeo, which may set cookies, as the Embed block does; pressing play is the visitor's choice to load that one video. Once marketing and embedded content is allowed, the note goes away.
- Accessibility: the play control is named "Play video: <title>"; the frame gets the title; the transcript and description work as for a file. Captions come from YouTube or Vimeo (turned on in the player), so the captions check does not apply; the page checks note that captions for a hosted video are managed on the host, and the transcript is the way to make the words available on the page.
- Structured data: a hosted video gives VideoObject structured data with its
embedUrland thumbnail when it has a title.
Decisions
- Inline SVG, not a sprite file. A per-page sprite would break for blocks that arrive later (Personalize islands) and for front ends that render blocks themselves; a sprite file on the site breaks cross-origin. A curated subset keeps the library small; each icon on a page is a few hundred bytes.
- Lucide, for its breadth, consistent 24 px stroke style that sits well with text, and permissive license. Brand logos are not part of Lucide and are not offered.
- Overlay colors are brand tokens, never free colors, like every other color an editor picks.
- The anchors are assigned on the server from the layout being rendered, so the jump links and the ids always agree; the On this page list covers the page's own blocks, not those inside shared blocks or site components.
- The video script lives in the widgets script the page already carries for Carousel, Accordion and Tabs; a page with a hosted video carries it too.
- Thumbnails are cached in the data folder, not the media library, so they never show up as media items; a thumbnail is fetched at most once per video (a failure is retried after an hour).
Importer
- An
iframefrom YouTube or Vimeo becomes a Video block with the video's address and its title, instead of an Embed. - A section or
divwith an inlinebackground-imagethat holds a heading and text becomes a Section with that background image (downloaded into the media library like any image), a Dark overlay at 60 percent and automatic text color.
Left for later
- Icons on menu items (the menu model is being changed elsewhere).
- Highlighting the current heading in On this page as the page scrolls.
- Local video files in the lightbox.
Spillway 0.1.24