Skip to content

hd-analog-clock

Live preview

<hd-analog-clock face="ticks" seconds="sweep"></hd-analog-clock>

Attributes and example

hd-analog-clock

The time on a clock face, ticking on its own: square, as big as its parent allows. No second hand on e-ink or without motion (it then moves once a minute). Coloured by --hd-clock-face, --hd-clock-rim, --hd-clock-marks, --hd-clock-hours, --hd-clock-numbers, --hd-clock-hands and --hd-clock-second; parts: ::part(face), ::part(marks), ::part(numbers), ::part(hand), ::part(second), ::part(pin).

AttributeWhat it is
faceA mark for every minute (the hours bolder), the twelve hours written out, or only the hours.One of ticks, numbers, plain. Default ticks.
secondsThe second hand: jumping every second, sweeping smoothly, or none.One of tick, sweep, none. Default tick.
<hd-analog-clock face="ticks" seconds="sweep"></hd-analog-clock>

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-accent
The theme’s accent: active controls, links, highlights.
--hd-border
Lines round tiles and between parts.
--hd-clock-face
CSS input read by hd-analog-clock.
--hd-clock-hands
CSS input read by hd-analog-clock.
--hd-clock-hours
CSS input read by hd-analog-clock.
--hd-clock-marks
CSS input read by hd-analog-clock.
--hd-clock-numbers
CSS input read by hd-analog-clock.
--hd-clock-rim
CSS input read by hd-analog-clock.
--hd-clock-second
CSS input read by hd-analog-clock.
--hd-font-display
The font of big numbers and headings.
--hd-font-ui
The font of labels and running text.
--hd-text
Text and big numbers.
--hd-text-faint
The quietest text: hints, units, times.
--hd-text-muted
Labels and secondary text.

Exposed parts

hd-analog-clock::part(face) {  /* Your styles */}hd-analog-clock::part(hand) {  /* Your styles */}hd-analog-clock::part(marks) {  /* Your styles */}hd-analog-clock::part(numbers) {  /* Your styles */}hd-analog-clock::part(pin) {  /* Your styles */}hd-analog-clock::part(second) {  /* Your styles */}

Style the host

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