Skip to content

hd-cover

Live preview

<hd-cover kind="blinds" position="{{ cap.windowcoverings_set }}" size="64px"></hd-cover><hd-cover kind="curtains" position="{{ cap.windowcoverings_set }}" size="64px"></hd-cover>

Attributes and example

hd-cover

A window with blinds or curtains, or a garage door, that moves: blinds roll up into the top, curtains bunch at the sides, a sectional garage door rolls up with its light blinking. A new position springs into place (a garage door settles with a thud as it closes); while the motor runs the slats travel, the curtains sway, the garage light blinks. Reduced motion: no travel; e-ink snaps.

AttributeWhat it is
kindWhat covers it.One of blinds, curtains, garage. Default blinds.
positionHow far it is open, 0–1, e.g. {{ cap.windowcoverings_set.value }}. Or a live capability of any device, followed and fitted into its own range: {{ cap.measure_battery }} (0–100) just works.
movingThe motor: up, down or idle.One of up, down, idle.
sizeIts width (CSS), e.g. 64px; or set --size.Default 64px.
<hd-cover kind="blinds" position="{{ cap.windowcoverings_set }}" size="64px"></hd-cover><hd-cover kind="curtains" position="{{ cap.windowcoverings_set }}" size="64px"></hd-cover>

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-cool
The cool counterpart: cooling, cold water, low prices on some themes.
--hd-cover-frame
CSS input read by hd-cover.
--hd-cover-ink
CSS input read by hd-cover.
--hd-cover-paper
CSS input read by hd-cover.
--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-cover.
--hd-surface-raised
Something on a tile that stands out from it, like a button.
--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-cover {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables