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…
<image-editor> lets a visitor crop, rotate, flip, resize and filter an image in the browser, then export it. It reads Vanilla Breeze design tokens and follows the active theme and light or dark mode with no setup.
Members of <image-editor>. The attributes above are also available as properties: src, mode, format, quality, maxHistory, readonly, noToolbar and aspectRatio.
Member
Purpose
loadImage(source)
Loads an image from a URL, a File or a Blob. Returns a promise.
crop(x, y, w, h), resize(w, h)
Crop to a region, or resize, in pixels.
rotate(degrees), flipHorizontal(), flipVertical()
Rotate in steps of 90 degrees, or mirror the image.
applyFilter(name, value), resetFilters()
Apply or clear filters. Names and ranges: brightness and contrast 0.5 to 2, saturate 0 to 3, blur 0 to 10 pixels, grayscale and sepia 0 to 100 percent.
undo(), redo(), reset()
Step through the edit history, or return to the image as loaded.
zoomTo(level), zoomToFit()
Set the zoom, where 1 is 100 percent, or fit the image in the workspace.
Read-only. The state of the history, the zoom and the open tool.
sourceFormat, exifData
Read-only. The file type of the loaded image and its EXIF metadata (data a camera stores in the file). The metadata comes from the file, so treat it as untrusted.
supportedFormats, supportsFilters
Read-only. The formats this browser can export, and whether it can apply filters. Where it cannot, the Filters tool is hidden and applyFilter() does nothing.
<image-convert> has the properties mode, format, quality, accept and the read-only supportedFormats, and one method, loadFile(file).
<image-convert> has nine properties with the prefix --image-convert-: bg, border-color, border-radius, margin, font-family, text-color, text-muted, accent-color and on-accent-color.
The editor reads Vanilla Breeze tokens directly. Custom properties inherit into the shadow DOM, so no setup is needed. Theme and mode changes apply at once, without losing edits.
Token
Drives
--color-surface
Editor background
--color-surface-raised
Toolbar, tool options bar and status bar background
--color-surface-sunken
Workspace behind the image
--color-border, --border-width-thin
Border color and width
--color-text, --color-text-muted
Text; button icons and the status bar
--color-interactive, then --color-primary
Accent color: the active tool, crop border and handles, slider thumbs
--color-text-on-interactive-auto, then --color-text-on-primary
Text on accent-colored buttons
--color-hover-bg
Button hover background
--focus-ring-color, then --color-focus-ring; --focus-ring-width
Focus outline
--font-sans, --font-size-xs, --font-size-s
Typeface and text sizes
--size-3xs to --size-xl
Padding, gaps and control sizes
--radius-s, --radius-m
Corner radius of buttons and of the editor frame
--duration-fast
Transition speed
The fallback order for each value is: the --image-editor-* property if you set it, then the Vanilla Breeze token, then a built-in default. Without Vanilla Breeze the built-in defaults apply.
For light and dark mode the editor looks at data-mode on the nearest ancestor, then the inherited color-scheme, then the system setting. Setting mode="dark" on the editor also sets data-mode on it, so Vanilla Breeze works out its dark tokens for that element. The README notes one limit: Vanilla Breeze 0.5.0 can only scope data-mode="dark" regions, so mode="light" inside a dark page stays dark on that version.