Skip to content

Theming

Every colour the components paint rides a CSS custom property with a light fallback baked in. Import the default skin once —

import "@azohra/meteo.station/styles.css";

— and wrap your markup in .meteo-root for the token set. Override any token on any ancestor to retheme.

  • .meteo-root carries the tokens and color-scheme. Components outside a .meteo-root still render (the light fallbacks apply); inside one, every token is themeable.
  • The whole sheet ships inside @layer meteo, so your unlayered CSS always outranks it — no specificity fights, no !important.

Tokens are defined once via light-dark() with color-scheme: light dark on the root, so the system preference picks the theme with no duplicate token blocks. A manual toggle sets data-theme="dark" (or "light") on .meteo-root — a one-line color-scheme pin that beats the system preference:

<div class="meteo-root" data-theme="dark"></div>

Remove the attribute (or set any other value) to return to following the system. Because both arms of every token are always declared, a theme switch is instant and complete — there is no partially-themed state.

Everything the platform ships — classes and tokens — starts with meteo-, so one grep of your page finds all of it. Within that root, three tiers:

  • Bare meteo-* — the shared skin and generic furniture any capability may use: surfaces, ink, meteo-grid-line, meteo-tick, meteo-cursor, meteo-hit, meteo-microlabel, the freshness badge, the value/unit spans.
  • meteo-band-* — speed grading, deliberately platform-wide: today the station components wear meteo-band-0..n; any future capability that grades wind speeds wears the same tokens.
  • meteo-<family>-* — component-family scope. Wind lives only where wind is actually visualized: meteo-wind-* (dial, rose, the wind history chart, vanes, the lull–gust band). Station-level artifacts are station-scoped — meteo-station-card-*, meteo-station-table-*, meteo-current-*, meteo-summary-* — because a station is a weather station, not a wind station. Alongside: meteo-air-*, meteo-trend-*, meteo-strip-*, meteo-sparkline-*. The Meteogram renderer already follows the same pattern (meteo-gram-*, themed on the defaults and tokens page), and future capabilities continue it (meteo-sounding-*).

Some of the vocabulary is deliberately unstyled: the default skin paints nothing on these classes — they exist as consumer styling seams, stable handles on parts the skin leaves alone. They are versioned API like every other class, and a test holds the list against both the source and the stylesheet.

ClassSeam
meteo-speed / meteo-temperature / meteo-pressureThe reading’s kind, on each text atom’s <data> element
meteo-grid-labelAxis labels in the SVG charts
meteo-tickAxis tick marks in the SVG charts
meteo-wind-gapThe dropout gap group in the wind charts
meteo-wind-vane-calmA calm hour’s vane glyph
meteo-wind-dialThe dial’s SVG root
meteo-wind-dial-bezelThe dial’s bezel ring
meteo-wind-needleThe dial’s direction needle
meteo-current-observed / meteo-current-chillThe current-conditions reading rows
meteo-current-flank-gust / meteo-current-flank-lullThe gust and lull flanks around the dial
meteo-station-card-identity / -elevation / -sourceThe station card’s header regions
meteo-station-table-time / meteo-strip-timeTime cells in the table and the strip
meteo-air-cornerThe air matrix’s corner cell

Unstyled by design: style them from your own CSS, or leave them be — the default look does not depend on them.

TokenRole
--meteo-surfaceCard and panel background
--meteo-surface-raisedRaised elements (dial face, matrix header)
--meteo-inkPrimary text and strokes
--meteo-mutedSecondary text, axis labels
--meteo-borderCard and table borders
--meteo-gridChart gridlines
--meteo-accentThe accent (ungraded traces, links, emphasis)
--meteo-gapDropout hatching in charts
--meteo-cursorThe chart inspector cursor
--meteo-freshness-live / -aging / -staleThe freshness badge states
--meteo-fontFont stack for all component text (incl. SVG)
--meteo-radiusCorner radius
--meteo-shadowCard shadow

--meteo-band-* — speed grading, platform-wide

Section titled “--meteo-band-* — speed grading, platform-wide”
TokenRole
--meteo-band-0--meteo-band-4Speed grading, calm → strong
TokenRole
--meteo-wind-band-fillThe lull–gust envelope fill
--meteo-wind-meanThe mean trace when ungraded
--meteo-wind-vaneVane glyphs in the direction row
--meteo-wind-compareThe day-over-day compare overlay trace
--meteo-wind-favorable / --meteo-wind-unfavorableThe rose’s judgment ring

thresholds (React) grades traces, dial arcs, and rose petals into meteo-band-0..n classes — what a band means and what colour it wears belong to your CSS. Three thresholds make four bands; add --meteo-band-* overrides (and rules for higher indices if you declare more thresholds) to speak your own colour language.

  • The skin control on the site’s /station/ gallery exercises exactly this mechanism: data-theme on .meteo-root, nothing else.
  • If your page also styles color-scheme globally, the root’s own declaration wins inside .meteo-root — the components stay coherent even when the page around them disagrees.
  • README imagery is generated from these very tokens (pnpm station-assets reads styles.css), so the docs never drift from the palette.