Skip to content

hd-weather-icon

Live preview

<hd-weather-icon condition="partly" size="48px"></hd-weather-icon><hd-weather-icon condition="rain" intensity="light" size="48px"></hd-weather-icon><hd-weather-icon condition="clear" night size="48px"></hd-weather-icon>

Attributes and example

hd-weather-icon

The weather, drawn from registry icons and moving calmly: the sun turning, the moon under twinkling stars, clouds drifting, rain falling, snow fluttering, lightning striking, fog sliding. Reduced motion and e-ink: still.

AttributeWhat it is
conditionWhat the sky does.One of clear, partly, cloudy, fog, rain, sleet, snow, thunder. Default cloudy.
intensityHow much falls.One of light, moderate, heavy. Default moderate.
nightThe moon instead of the sun.Default false.
showersThe sun breaking through, behind the cloud.Default false.
sizeIts size (CSS), e.g. 48px; or set --size.Default 48px.
labelAccessible label; otherwise the condition.
<hd-weather-icon condition="partly" size="48px"></hd-weather-icon><hd-weather-icon condition="rain" intensity="light" size="48px"></hd-weather-icon><hd-weather-icon condition="clear" night size="48px"></hd-weather-icon>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-appearance
`light`, `dark` or `paper`, for what colours alone can’t decide.
--hd-cool
The cool counterpart: cooling, cold water, low prices on some themes.
--hd-flat
1 on e-ink: no colours, glows or gradients, only black and white.
--hd-lit
The warm colour of a device that is on.
--hd-motion-tempo
CSS input read by hd-weather-icon.
--hd-text
Text and big numbers.
--hd-text-muted
Labels and secondary text.
--hd-warn
Worth a look: a low battery, a door open for a while.

Style the host

hd-weather-icon {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables