All files / src/components/Spinner track.ts

100% Statements 3/3
100% Branches 4/4
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10        135x 63x        
/** How a variant's `track` prop resolves:
 *  - `attr` marks the track element (`data-vslk-track`): "auto" or the color;
 *  - `color` is the CSS color to paint it with. */
export function resolveTrack(track: boolean | string | undefined) {
  if (!track) return null;
  return track === true
    ? { attr: "auto", color: "color-mix(in srgb, currentColor 20%, transparent)" }
    : { attr: track, color: track };
}