Utilities✨ Premium

Double Line Border

Two concentric lines around a box: on the inner one, a pink arc and a cyan arc turn in opposite directions; on the outer one, a violet arc.

CSS@propertyMulti-layer

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Utilities has 43 effects, including 3 free. Explore the category →

3 usage examples

Caller's picture during an incoming call — Double Line Border example 1

① Caller's picture during an incoming call

WhenIn the Palvorine video app, the incoming-call card wraps the caller's badge in two rings whose green and cyan arcs turn for as long as it rings, above the Decline and Answer buttons.
WhyTwo movements in opposite directions suggest ringing with no sound or flashing; with a radius equal to half the size, the box becomes a perfect circle around the avatar.
Settings--dlb-w: 96px; --dlb-h: 96px; --dlb-radius: 48px; --dlb-fill: #151821 (the card background); --dlb-c1: #4ade80; --dlb-c2: #22d3ee; --dlb-c3: #a3e635; --dlb-speed: 2.4s.
Matchmaking in a card game — Double Line Border example 2

② Matchmaking in a card game

WhenIn Escarvoine, a click on “Start a match” replaces the lobby with a waiting card framed by the two lines, with a timer and a Cancel button.
WhyThe wait has no known length: a continuous rotation says “searching” better than a progress bar that would make up a percentage.
Settings--dlb-w: 236px; --dlb-h: 150px; --dlb-radius: 16px; --dlb-fill: #130f22; default colours; the box has role="status". For the capture, the scene starts the search by itself on load.
Product launch countdown — Double Line Border example 3

③ Product launch countdown

WhenOn the launch page of the Orvaldine lamp, the days, hours, minutes and seconds left sit in a wide frame whose golden arcs turn slowly.
WhyIn brass tones and at a slower pace, the double line becomes a setting rather than a signal: it shows off the numbers without drawing more attention than they do.
Settings--dlb-w: 404px; --dlb-h: 112px; --dlb-radius: 20px; --dlb-fill: #15110b; --dlb-c1: #f4c56a; --dlb-c2: #fde7b0; --dlb-c3: #d97706; --dlb-speed: 5s; --dlb-speed-outer: 7s. The countdown is wired in the scene.

How it works

The .dlb-box (200 × 120 px, 12 px radius) is wrapped in two lines separated by 1 px of background. The inner line, 6 px wide, sits 3 px on each side of the edge; the outer line, 3 px wide, runs between 4 and 7 px outside. Each line is a conic-gradient layer that is almost entirely transparent and shows only one arc of colour; solid layers in the --dlb-fill colour (the box background, the 1 px gap) cover the rest, so only the arcs on the two rings remain visible.

The inner line carries two arcs of about a fifth of a turn each: a pink one (::before) going clockwise and a cyan one (::after) going the other way, one turn every 3 s. They cross twice per turn. The outer line (.dlb-outer-ring) carries a longer, softer violet arc turning backwards in 4 s.

The rotation drives the starting angle of the gradients, --dlb-a1 and --dlb-a2, declared with @property as real angles, so the browser can animate them from 0 to 360°. The effect is fully automatic: it does not react to hover, click or focus.

Accessibility

  • Decoration only: the box is not interactive (no hand cursor, no keyboard stop) and its arcs have nothing to announce; the text or image inside is read normally by screen readers.
  • Reduced motion: with prefers-reduced-motion: reduce, the three arcs stop at three different places (pink at the bottom, cyan at the top, violet on the left), so both lines stay visible without moving.
  • Say the state in words: if the arcs signal a wait (a ringing call, a search in progress), write it too: a role="status" on the box and a sentence such as “Looking for an opponent…” are enough.
  • Inside a clickable card: the effect does not change on focus. If you put a link or a button in the box, give it its own :focus-visible style.

Browser compatibility

Pure CSS, no JavaScript. Measured in Chromium 151, Firefox 153 and Playwright's WebKit 26.5: all three arcs visible and turning, two independent copies on one page, no overflow at 390 px, and no animation left under reduced motion. Minimum versions from @mdn/browser-compat-data: the rotation needs @property (Chrome 85, Firefox 128, Safari 16.4); the layers use inset (Chrome 87).

Chrome 87+✓ Full (measured in version 151)
Firefox 128+✓ Full (measured in version 153); from 83 to 127, arcs visible without smooth rotation
Safari 16.4+✓ Full (measured in WebKit); from 14.1 to 16.3, arcs visible without smooth rotation
Edge 87+✓ Full (Chromium engine)
Safari iOS 16.4+✓ Full
Chrome Android 87+✓ Full (Chromium engine)

A browser that ignores @property keeps the gradients valid thanks to a fallback angle inside var(): both lines show their arcs, without smooth rotation (checked by removing the @property rules in Chromium).

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0769-root">
  <div class="dlb-box">
    <span class="dlb-outer-ring"></span>
    <span class="dlb-outer-mask"></span>
    <span class="dlb-inner-mask"></span>
    Double Line
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
--dlb-c1, --dlb-c2 #ec4899, #06b6d4 Colours of the two arcs on the inner line (clockwise, anticlockwise).
--dlb-c3 #8b5cf6 Colour of the arc on the outer line.
--dlb-speed 3s Time for one turn of the inner arcs.
--dlb-speed-outer 4s Time for one turn of the outer arc; a value different from the previous one keeps the arcs from always meeting at the same spot.
--dlb-w, --dlb-h, --dlb-radius 200px, 120px, 12px Size and corner radius; both lines follow the radius. A radius of half a square box gives a circle.
--dlb-fill #0a0a0f Background of the box and of the gap between the lines: give it the colour of the surface the box sits on.

FAQ

A plain CSS variable is just a piece of text: the browser does not know it holds an angle, so it cannot move it smoothly from 0 to 360°. Declared with @property and the <angle> syntax, it becomes animatable, and the conic gradient using it turns frame by frame.
Yes, as in the incoming-call example: anything you place after the three <span> elements is drawn above the layers. For a round photo, use a square box with --dlb-radius at half its size, and an image slightly smaller than the box so the inner line stays visible.
Yes, as long as you set --dlb-fill to that light background: this colour hides the inside of the box and the 1 px gap between the two lines. Then pick arcs dark or saturated enough to stand out on white.