Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

Surfaces

The background levels a Vanilla Breeze page is built from, the data-surface attribute for translucent and paper surfaces, and the tokens behind the page background and overlays.

Surface levels

A page is a stack of surfaces: the page itself, panels on it, and things that sit above or below a panel. Each level has a color token, and each token has a light and a dark value. Pick the token by the level, and text set in --color-text stays readable on it.

Token Level Used by
--color-backgroundThe page<body>, and any region with its own data-theme or data-mode
--color-surfaceA panel on the page<layout-card>, text inputs
--color-surface-raisedAbove a panelHover backgrounds in menus and lists, aside.note
--color-surface-sunkenSet into a panelThe file input drop area, editor and comment wells
--color-surface-altAn alternate fill beside a surfaceThe track of a segmented control
--color-surface-overlayFloating over scrolling contentDialogs, menus, sticky headers

In the default light theme the page and the panel are both white, and depth comes from shadows and borders. In dark mode each level is a step lighter than the one below it, because a shadow shows little on a dark page.

Surface types

The data-surface attribute changes how one region paints its background. It works on any element. Four values make the region translucent, and five give it a paper texture.

Value Result
frostedThe surface color at 75% opacity, a blur of what is behind it, and a faint border
tintedThe accent color at 10% opacity over a light blur
ghostA surface that is almost clear, with a faint outline and no shadow
transparentNo background and no shadow
paperOff-white paper with a fine grain (charcoal in dark mode)
dotsPaper with a dot grid
gridPaper with ruled squares
linesRuled paper with a margin line
kraftBrown kraft paper with a fine grain (dark brown in dark mode)

Tuning the translucent types

The translucent types read a small set of tokens. The one to know is --glass-blur: its default is 12px, and a theme or your CSS can change it. The Glassmorphism theme sets 16px.

Token Default Affects
--glass-blur12pxThe blur behind frosted
--glass-saturate160%How much frosted boosts the color behind it
--glass-surface-opacity0.75The opacity of the frosted fill
--glass-border-opacity0.2The opacity of the frosted border
--glass-tint-opacity0.1The opacity of the tinted fill

Text over a translucent surface is only as readable as what shows through. Check the contrast against the busiest thing that can end up behind it, or keep such surfaces for headers and panels over a plain background.

Paper types and dark mode

Each paper type has a light and a dark version, and follows the mode like any other surface: pale paper with dark text in light mode, dark paper with light text in dark mode. The colors come from five tokens, --surface-paper, --surface-kraft, --surface-dot, --surface-rule and --surface-margin. To keep a sheet pale on a dark page, put data-mode="light" on the same element. It gives the region the light paper and light-mode text and controls.

Kraft is darker than the other papers in light mode, so the surface adjusts two colors for its contents: muted text is derived from the body text color, and links use the primary color with its lightness capped. Both measure above 4.5:1 against the paper in the default theme, and the link cap applies to any theme's primary color.

Reduced transparency

When the reader has asked the system to reduce transparency, frosted, tinted, ghost and transparent all become a solid --color-surface with no blur. You do not write anything for this. See Preferences and themes.

The page background

<body> paints from its own set of tokens, so a theme or a page can change the page color or add a gradient or an image without a rule on body. The gradient is painted over the image, and both over the color.

Token Default
--page-bg-colorvar(--color-background)
--page-bg-gradientnone
--page-bg-imagenone
--page-bg-attachment, --page-bg-size, --page-bg-position, --page-bg-blendscroll, cover, center, normal

To float the header, main content and footer as separate panels over that background, add data-backdrop to <html>. The <html> page lists its values, and data-canvas does the same for a single element.

Overlays

Two more tokens cover what sits over the page.

Token Default Used for
--color-backdropBlack at 50% opacityThe scrim behind a modal <dialog>
--backdrop-blur2pxThe blur of the page behind that scrim

Anything that floats over scrolling content should use --color-surface-overlay for its background. It equals --color-surface by default. A theme with translucent surfaces sets it to an opaque color, so menus and dialogs stay readable.

Texture tokens

Five tokens hold repeating patterns you can lay over a surface: --texture-noise, --texture-grain, --texture-dots, --texture-grid and --texture-lines. Nothing in the default theme uses them. The dots, grid and lines patterns are drawn in currentColor. Paint one on a pseudo-element so its opacity does not affect the content.

--surface-texture-opacity is 0.05 by default.

↑