Glow border

Replaces the border of the surface it wraps with a colored glow that follows a light or runs around it.

<tp-mo-glow-border>
Glow border
Default density Compact density Restart from the initial state Show the copyable source

Tide station 7

Readings every ten minutes from the north pier.

Water level 2.4 m and rising. Move the pointer toward the edge.

Usage

Wrap one surface in Glow border: a Card, a Button, an Input, a Text area, a Select, an Input group, a Toggle, or any element with a border. Glow border hides that surface’s border and draws its own line at exactly the same place, radius and width, so nothing around it moves. It also draws the focus ring and shows an invalid control in the destructive color; the surface keeps its behavior. The drawing lets pointer events through and is hidden from assistive technology.

The glow colors each point of the line from a list of colors spread around the border, and turns it white-hot where its light is closest, with a soft bloom around it. By default the light is the pointer: the stretch of line nearest a mouse or pen lights up as it comes near and fades out after it leaves. Under reduced motion the light jumps instead of following, comets and glints rest, and fades are instant.

Controls and fields

Glow border follows each surface’s own shape, from a small Button to a multi-line Text area. On fields, trigger="focus" lights only the field being edited; the glow is then the focus indicator, so no separate focus ring is drawn.

Controls and fields
Default density Compact density Restart from the initial state Show the copyable source

Report a sighting

Logged to the harbor master's desk.

Send report

Comets

With trigger="always" the glow runs on its own. Comets travel around the border continuously, always evenly spaced, each with a white-hot head and a tail that takes the colors it passes. lights sets how many, light-spacing bunches them, and rotation sets the way they go. --tp-mo-glow-border-loop-delay fades them out between laps and --tp-mo-glow-border-loop-easing eases each lap.

Comets
Default density Compact density Restart from the initial state Show the copyable source

Relay A

Two comets, the default.

Relay B

Three comets, counterclockwise, resting between laps.

Sweep, pulse and glint

motion picks what the glow does, and a named motion plays on its own. sweep lights the whole border and turns its colors around it, pulse makes the whole glow breathe, and glint sends a band of light across the surface once a lap, like a reflection. Motions combine: sweep pulse turns and breathes.

Sweep, pulse and glint
Default density Compact density Restart from the initial state Show the copyable source

Syncing

Uploading 18 of 42 readings.

Listening

Waiting for the next buoy signal.

New report

Tide tables for November are ready.

Hover

trigger="hover" runs the motion while the surface is hovered, fading in and out, like trigger="focus" on the fields above. trigger="none" keeps the glow off.

Hover
Default density Compact density Restart from the initial state Show the copyable source

Harbor cam

Live from the east breakwater.

Hover to light the frame.

Fading

The glow fades in and out over --tp-mo-glow-border-fade-duration with --tp-mo-glow-border-fade-easing. --tp-mo-glow-border-fade-out-delay keeps it lit for a moment after the light leaves, holding where it last shone; a light that comes back fades in at once and never waits. --tp-mo-glow-border-fill adds a wash of the light’s color inside the surface.

Lingering light
Default density Compact density Restart from the initial state Show the copyable source

Lighthouse

Leave the edge: the light lingers, then fades.

Colors

--tp-mo-glow-border-colors takes the colors to spread around the border, each blending into the next along the hue circle and the last back into the first; --tp-mo-glow-border-angle sets where the first one sits. Neighboring hues blend best, like the warm chart colors on the plan below; a single color, like the ring color on the prompt, lights the whole line in that color. --tp-mo-glow-border-core is the color the line turns toward where the light is hottest: white on dark color schemes and none on light ones by default. --tp-mo-glow-border-width, --tp-mo-glow-border-spread and --tp-mo-glow-border-intensity set the line, the bloom and the strength.

Custom colors
Default density Compact density Restart from the initial state Show the copyable source

Observer

For crews logging every tide.

Popular

$18 per month

Start observing
Send

Light sources

The light follows the pointer by default. track-target names an element whose center lights the border instead, followed as it moves, and the trackPoint property takes a point in viewport coordinates. track-reach sets how far the light carries.

Lit by an element
Default density Compact density Restart from the initial state Show the copyable source

Beacon 12

Lit from the beacon beside it.

Limits

  • Glow border draws over one surface, its first child element.
  • The bloom reaches outside the surface, so an ancestor that clips its overflow cuts it off.
  • An element light source is measured on every frame while the border is in view.

API Reference

Every element also accepts motion-policy.

Attributes

AttributePropertyTypeDefaultDescriptiontriggertriggerGlowBorderTrigger | ''''When the glow lights and moves: none, always, hover, focus (while focus is inside) or pointer (lit by the pointer, track-target or trackPoint). Unset, always when motion names a motion, and pointer otherwise.motionmotionstring''Tokens of comets, sweep, pulse and glint, which combine. Unset, comets.lightslightsnumber2Number of comets.light-spacinglightSpacingnumber | nullnullDistance between consecutive comets, as a fraction of the border; even when unset.rotationrotationGlowBorderRotation'cw'Which way comets, the sweep and the glint go: cw or ccw.track-targettrackTargetstring''The id of an element whose center lights the border instead of the pointer.track-reachtrackReachnumber160Distance in pixels at which the tracked light fades to nothing.

Properties

PropertyTypeDefaultDescriptiontrackPointPointerPoint | nullnullA point in viewport pixels that lights the border instead of the pointer.

Methods

MethodReturnsDescriptionrefresh()voidMeasures the surface again (after a change the element cannot observe).

Slots

SlotDescriptiondefaultOne surface: a Card, Button, Input, Text area, Select, Input group, Toggle or any element.

CSS parts

PartDescription::part(mo-glow-border-ring)The drawing over the surface border, hidden from assistive technology.::part(mo-glow-border-focus)The focus ring, outside the border, while keyboard focus is inside and the effect does not show it.::part(mo-glow-border-line)The border line where the glow does not light it.::part(mo-glow-border-glow)The canvas of the lit line and its wash.::part(mo-glow-border-bloom)The canvas of the blurred light around the line.

CSS custom properties

PropertyDefaultDescription--tp-mo-glow-border-color—Line color where it is not lit. Default: the border role.--tp-mo-glow-border-width—Line width. Default the surface's border width.--tp-mo-glow-border-radius—Corner radius without a surface child. Default var(--tp-radius-lg).--tp-mo-glow-border-colors—The glow's colors, spread evenly around the border, each blending into the next along the hue circle and the last back into the first. Default the theme's sky, violet and pink chart colors (--tp-chart-2, --tp-chart-1, --tp-chart-5).--tp-mo-glow-border-angle—Where the first color sits, 0deg at the top and clockwise. Default 315deg (the top-left corner).--tp-mo-glow-border-core—The color the glow turns toward where the light is hottest. Default white on dark color schemes, none on light ones.--tp-mo-glow-border-intensity—Glow opacity, 0 to 1. Default 1.--tp-mo-glow-border-spread—Width of the bloom around the lit line. Default 12px.--tp-mo-glow-border-fill—Opacity of the pointer light's wash over the surface. Default 0.--tp-mo-glow-border-light-length—Length of a comet's tail, as a fraction of the border. Default 0.22.--tp-mo-glow-border-loop-duration—Time of one lap: a comet's round, a sweep's turn, a breath or a glint's pass. Default eight times var(--tp-duration-normal).--tp-mo-glow-border-loop-delay—Pause between laps, with the glow faded out. Default 0s.--tp-mo-glow-border-loop-easing—Easing of each lap. Default linear.--tp-mo-glow-border-fade-duration—Time of the glow's fade in and out. Default var(--tp-duration-normal).--tp-mo-glow-border-fade-easing—Easing of the fade. Default var(--tp-easing-standard).--tp-mo-glow-border-fade-out-delay—Wait before fading out; fading in never waits. Default var(--tp-duration-fast).