Skip to content

Write HTML. Render video. Built for agents.

fix(studio): timeline colours all resolve from tokens (#4249)

Miguel Ángeleeabbe839f56
diff --git a/packages/studio/src/player/components/AudioWaveform.tsx b/packages/studio/src/player/components/AudioWaveform.tsx
index ffefd12551..abc0ab63fb 100644
--- a/packages/studio/src/player/components/AudioWaveform.tsx
+++ b/packages/studio/src/player/components/AudioWaveform.tsx
@@ -1,4 +1,4 @@
-import { memo, useCallback, useMemo, useRef } from "react";
+import { memo, useCallback, useEffect, useMemo, useRef } from "react";
import { useMountEffect } from "../../hooks/useMountEffect";
import { useThumbnailLease } from "../../hooks/useThumbnailLease";
import { createThumbnailKey, type ThumbnailPriority } from "../lib/thumbnailScheduler";
@@ -136,11 +136,12 @@ export const AudioWaveform = memo(function AudioWaveform({
const end = Math.max(start + 1, Math.ceil(endFraction * peaks.length));
const span = end - start;
const barCount = Math.floor(width / BAR_STEP);
+ const waveformBarRgb = getComputedStyle(canvas).getPropertyValue("--timeline-waveform-bar-rgb");
for (let index = 0; index < barCount; index++) {
const peakIndex = start + Math.min(span - 1, Math.floor((index / barCount) * span));
const amplitude = peaks[peakIndex] ?? 0;
const barHeight = Math.max(2, amplitude * height);
- context.fillStyle = `rgba(75,163,210,${(0.45 + amplitude * 0.4).toFixed(2)})`;
+ context.fillStyle = `rgba(${waveformBarRgb},${(0.45 + amplitude * 0.4).toFixed(2)})`;
context.fillRect(index * BAR_STEP, height - barHeight, BAR_WIDTH, barHeight);
}
}, [peaks, trimEndFraction, trimStartFraction]);
@@ -157,6 +158,16 @@ export const AudioWaveform = memo(function AudioWaveform({
[draw],
);
+ useEffect(() => {
+ const root = document.documentElement;
+ const observer = new MutationObserver(draw);
+ observer.observe(root, {
+ attributes: true,
+ attributeFilter: ["class", "data-chrome", "data-theme", "style"],
+ });
+ return () => observer.disconnect();
+ }, [draw]);
+
useMountEffect(() => () => observerRef.current?.disconnect());
return (
@@ -170,8 +181,7 @@ export const AudioWaveform = memo(function AudioWaveform({
<div
className="absolute inset-x-0 bottom-0 top-4 animate-pulse"
style={{
- background:
- "linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)",
+ background: "var(--timeline-thumbnail-shimmer)",
}}
/>
)}
@@ -187,8 +197,7 @@ export const AudioWaveform = memo(function AudioWaveform({
style={{
bottom: "20%",
height: 2,
- background:
- "repeating-linear-gradient(90deg, rgba(75,163,210,0.35) 0 2px, transparent 2px 5px)",
+ background: "var(--timeline-waveform-error)",
}}
/>
<span className="relative rounded-sm bg-black/50 px-1 text-[8px] text-neutral-500">
@@ -200,7 +209,7 @@ export const AudioWaveform = memo(function AudioWaveform({
<div className="absolute inset-x-0 top-0 z-10 px-1.5 py-0.5">
<span
className="block truncate text-[9px] font-semibold leading-tight"
- style={{ color: labelColor, textShadow: "0 1px 3px rgba(0,0,0,0.9)" }}
+ style={{ color: labelColor, textShadow: "var(--timeline-waveform-label-shadow)" }}
>
{label}
</span>
diff --git a/packages/studio/src/player/components/ImageThumbnail.tsx b/packages/studio/src/player/components/ImageThumbnail.tsx
index ab70bfd4b0..fc1432f904 100644
--- a/packages/studio/src/player/components/ImageThumbnail.tsx
+++ b/packages/studio/src/player/components/ImageThumbnail.tsx
@@ -91,8 +91,7 @@ export const ImageThumbnail = memo(function ImageThumbnail({
<div
className="absolute inset-0 animate-pulse"
style={{
- background:
- "linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)",
+ background: "var(--timeline-thumbnail-shimmer)",
}}
/>
)}
@@ -100,13 +99,12 @@ export const ImageThumbnail = memo(function ImageThumbnail({
<div
className="absolute inset-x-0 bottom-0 z-10 px-1.5 pb-0.5 pt-3"
style={{
- background:
- "linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)",
+ background: "var(--timeline-thumbnail-label-gradient)",
}}
>
<span
className="block truncate text-[9px] font-semibold leading-tight"
- style={{ color: labelColor, textShadow: "0 1px 2px rgba(0,0,0,0.9)" }}
+ style={{ color: labelColor, textShadow: "var(--timeline-thumbnail-label-shadow)" }}
>
{label}
</span>
diff --git a/packages/studio/src/player/components/LayerDisclosureRow.tsx b/packages/studio/src/player/components/LayerDisclosureRow.tsx
index 85b1a0f277..5de8ac2e93 100644
--- a/packages/studio/src/player/components/LayerDisclosureRow.tsx
+++ b/packages/studio/src/player/components/LayerDisclosureRow.tsx
@@ -37,8 +37,10 @@ export function LaneToggleButton({
title={`${isExpanded ? "Hide" : "Show"} lanes`}
// h-6 w-6 = the 24x24 WCAG 2.2 minimum target. The glyph stays 11px;
// only the hit box grows.
- className={`ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-[11px] leading-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${
- isExpanded ? "text-[#3CE6AC]" : "text-white/55 hover:text-white"
+ className={`ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 text-[11px] leading-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)] ${
+ isExpanded
+ ? "text-[var(--timeline-accent)]"
+ : "text-[var(--timeline-handle)] hover:text-[var(--timeline-text-solid)]"
}`}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
@@ -86,13 +88,16 @@ export function LayerDisclosureRow({
style={{
width: columnWidth,
height: TRACK_H,
- color: "#ffffff",
+ color: "var(--timeline-text-solid)",
background: gutterBackground,
}}
>
{/* Decorative: the disclosure button above already names the row's keyframe
state, and aria-label on a plain span is not exposed reliably anyway. */}
- <span aria-hidden="true" className="shrink-0 text-[13px] leading-none text-white/40">
+ <span
+ aria-hidden="true"
+ className="shrink-0 text-[13px] leading-none text-[var(--timeline-text-dim)]"
+ >
◇
</span>
<span title={name} className="min-w-0 flex-1 truncate font-medium leading-tight">
diff --git a/packages/studio/src/player/components/PlayheadIndicator.tsx b/packages/studio/src/player/components/PlayheadIndicator.tsx
index f6793f3927..ea79037c7f 100644
--- a/packages/studio/src/player/components/PlayheadIndicator.tsx
+++ b/packages/studio/src/player/components/PlayheadIndicator.tsx
@@ -26,8 +26,8 @@ interface PlayheadIndicatorProps {
}
export function PlayheadIndicator({
- color = "var(--hf-accent, #3CE6AC)",
- glowColor = "rgba(60,230,172,0.14)",
+ color = "var(--timeline-accent)",
+ glowColor = "var(--timeline-playhead-glow)",
scrubbing = false,
stickyHead = true,
}: PlayheadIndicatorProps) {
@@ -93,7 +93,7 @@ export function PlayheadIndicator({
background: scrubbing ? color : "transparent",
border: `1.5px solid ${color}`,
boxSizing: "border-box",
- boxShadow: `0 1px 3px rgba(0,0,0,0.55), 0 0 5px ${glowColor}`,
+ boxShadow: `0 1px 3px var(--timeline-playhead-shadow), 0 0 5px ${glowColor}`,
transform: "rotate(45deg)",
}}
/>
diff --git a/packages/studio/src/player/components/TimelineAutomationLane.test.tsx b/packages/studio/src/player/components/TimelineAutomationLane.test.tsx
index 86fe9f0607..96e1e43232 100644
--- a/packages/studio/src/player/components/TimelineAutomationLane.test.tsx
+++ b/packages/studio/src/player/components/TimelineAutomationLane.test.tsx
@@ -483,7 +483,7 @@ describe("TimelineAutomationLane", () => {
// Bigger than the points around them, and ringed rather than recoloured — the
// fill is the parameter's own colour and stays that way.
expect(Math.min(...radii)).toBeGreaterThan(Math.max(...plain));
- expect(marked[0]?.getAttribute("stroke")).toBe("#fff");
+ expect(marked[0]?.getAttribute("stroke")).toBe("var(--timeline-text-solid)");
});
it("marks nothing when there is no range", () => {
diff --git a/packages/studio/src/player/components/TimelineAutomationLane.tsx b/packages/studio/src/player/components/TimelineAutomationLane.tsx
index 2c3570fbe7..00a1ee2a7b 100644
--- a/packages/studio/src/player/components/TimelineAutomationLane.tsx
+++ b/packages/studio/src/player/components/TimelineAutomationLane.tsx
@@ -75,7 +75,7 @@ function pointCircleStyle(
radius: POINT_R * (dragging ? 1.3 : inRange ? 1.15 : 1),
// A white ring rather than a different fill: the fill is the parameter's
// own colour, and a lane with two envelopes on it is read by colour first.
- stroke: inRange ? "#fff" : "rgba(0,0,0,0.5)",
+ stroke: inRange ? "var(--timeline-text-solid)" : "var(--timeline-automation-point-muted)",
strokeWidth: inRange ? 1.5 : 1,
};
}
@@ -132,7 +132,7 @@ function ReadOnlyNote({
return (
<div
data-automation-readonly-note=""
- className="hf-automation-readonly-note pointer-events-none absolute rounded-[3px] bg-black/85 px-1.5 py-0.5 text-[9px] text-white/80"
+ className="hf-automation-readonly-note pointer-events-none absolute rounded-[3px] bg-[var(--timeline-overlay-bg-strong)] px-1.5 py-0.5 text-[9px] text-[var(--timeline-overlay-text)]"
style={{ left: leftPx + 6, top: 2, zIndex: 3, maxWidth: Math.max(120, widthPx - 12) }}
>
{note}
@@ -470,7 +470,7 @@ export function TimelineAutomationLane({
x2={PAD_X + widthPx}
y1={pad + inner / 2}
y2={pad + inner / 2}
- stroke="rgba(255,255,255,0.08)"
+ stroke="var(--timeline-automation-rail)"
strokeDasharray="3 4"
/>
{rangeSelection ? (
@@ -541,7 +541,7 @@ export function TimelineAutomationLane({
cx={xOf(playheadSec)}
cy={yOf(currentValue)}
r={2.5}
- fill="#fff"
+ fill="var(--timeline-text-solid)"
opacity={0.8}
pointerEvents="none"
/>
@@ -561,7 +561,7 @@ export function TimelineAutomationLane({
{hint ? (
<div
- className="hf-automation-hint pointer-events-none absolute rounded-[3px] bg-black/80 px-1 py-0.5 font-mono text-[9px] text-white"
+ className="hf-automation-hint pointer-events-none absolute rounded-[3px] bg-[var(--timeline-overlay-bg)] px-1 py-0.5 font-mono text-[9px] text-[var(--timeline-text-solid)]"
style={{ left: leftPx + 6, top: 2, zIndex: 3 }}
>
{hint}
diff --git a/packages/studio/src/player/components/TimelineCanvas.tsx b/packages/studio/src/player/components/TimelineCanvas.tsx
index 324fd6d372..74f11dd062 100644
--- a/packages/studio/src/player/components/TimelineCanvas.tsx
+++ b/packages/studio/src/player/components/TimelineCanvas.tsx
@@ -94,7 +94,7 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
left: props.contentOrigin + gap.start * props.pps,
width: Math.max((gap.end - gap.start) * props.pps, 2),
height: TRACK_H - CLIP_Y * 2,
- background: loud ? "rgba(60,230,172,0.18)" : "rgba(60,230,172,0.055)",
+ background: loud ? "var(--timeline-accent-soft)" : "var(--timeline-accent-faint)",
borderRadius: 4,
zIndex: 25,
}}
@@ -112,8 +112,8 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
left: props.contentOrigin + draggedClip.previewStart * props.pps,
width: Math.max(draggedClip.element.duration * props.pps, 4),
height: draggedClipHeight,
- border: "1px solid color-mix(in srgb, var(--color-accent) 55%, transparent)",
- background: "color-mix(in srgb, var(--color-accent) 12%, transparent)",
+ border: "1px solid color-mix(in srgb, var(--timeline-accent) 55%, transparent)",
+ background: "color-mix(in srgb, var(--timeline-accent) 12%, transparent)",
borderRadius: 4,
zIndex: 30,
}}
@@ -132,8 +132,8 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
left: props.contentOrigin + props.dropPreview.start * props.pps,
width: DROP_PREVIEW_SECONDS * props.pps,
height: TRACK_H - CLIP_Y * 2,
- border: "1px solid color-mix(in srgb, var(--color-accent) 55%, transparent)",
- background: "color-mix(in srgb, var(--color-accent) 12%, transparent)",
+ border: "1px solid color-mix(in srgb, var(--timeline-accent) 55%, transparent)",
+ background: "color-mix(in srgb, var(--timeline-accent) 12%, transparent)",
borderRadius: 4,
zIndex: 30,
}}
@@ -151,8 +151,8 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
left: props.contentOrigin,
width: props.trackContentWidth,
height: 1,
- background: "#3CE6AC",
- boxShadow: "0 0 3px rgba(60,230,172,0.5)",
+ background: "var(--timeline-accent)",
+ boxShadow: "0 0 3px var(--timeline-accent-glow)",
zIndex: 55,
}}
/>
@@ -167,11 +167,14 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
top: RULER_H,
bottom: 0,
width: 1,
- background: snapGuide.type === "playhead" ? "#3CE6AC" : "rgba(255,255,255,0.6)",
+ background:
+ snapGuide.type === "playhead"
+ ? "var(--timeline-accent)"
+ : "var(--timeline-snap-guide)",
boxShadow:
snapGuide.type === "playhead"
- ? "0 0 6px rgba(60,230,172,0.5)"
- : "0 0 6px rgba(255,255,255,0.4)",
+ ? "0 0 6px var(--timeline-accent-glow)"
+ : "0 0 6px var(--timeline-text-dim)",
zIndex: 60,
}}
/>
@@ -201,8 +204,8 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
top: props.marqueeRect.top,
width: props.marqueeRect.width,
height: props.marqueeRect.height,
- background: "rgba(60,230,172,0.10)",
- border: "1px dashed rgba(60,230,172,0.7)",
+ background: "var(--timeline-accent-fill)",
+ border: "1px dashed var(--timeline-accent-border)",
borderRadius: 2,
zIndex: 70,
}}
@@ -220,9 +223,9 @@ export const TimelineCanvas = memo(function TimelineCanvas() {
width: Math.abs(props.rangeSelection.end - props.rangeSelection.start) * props.pps,
top: RULER_H,
bottom: 0,
- backgroundColor: "rgba(59, 130, 246, 0.12)",
- borderLeft: "1px solid rgba(59, 130, 246, 0.4)",
- borderRight: "1px solid rgba(59, 130, 246, 0.4)",
+ backgroundColor: "var(--timeline-info-bg)",
+ borderLeft: "1px solid var(--timeline-info-border)",
+ borderRight: "1px solid var(--timeline-info-border)",
zIndex: 50,
}}
/>
diff --git a/packages/studio/src/player/components/TimelineClipDiamonds.test.tsx b/packages/studio/src/player/components/TimelineClipDiamonds.test.tsx
index 59b86766c3..4264c2b53f 100644
--- a/packages/studio/src/player/components/TimelineClipDiamonds.test.tsx
+++ b/packages/studio/src/player/components/TimelineClipDiamonds.test.tsx
@@ -258,7 +258,9 @@ describe("TimelineClipDiamonds", () => {
const selectedDiamond = host.querySelector<HTMLButtonElement>('button[title="60%"]');
expect(playheadDiamond?.dataset.keyframeAtPlayhead).toBe("true");
expect(playheadDiamond?.dataset.keyframeSelected).toBe("false");
- expect(playheadDiamond?.querySelector("path:last-child")?.getAttribute("fill")).toBe("#a3a3a3");
+ expect(playheadDiamond?.querySelector("path:last-child")?.getAttribute("fill")).toBe(
+ "var(--timeline-diamond-muted)",
+ );
expect(playheadDiamond?.querySelector('path[stroke="#4ba3d2"]')).not.toBeNull();
expect(selectedDiamond?.dataset.keyframeAtPlayhead).toBe("false");
expect(selectedDiamond?.dataset.keyframeSelected).toBe("true");
diff --git a/packages/studio/src/player/components/TimelineClipDiamonds.tsx b/packages/studio/src/player/components/TimelineClipDiamonds.tsx
index 1f41a4881d..a56fce5b95 100644
--- a/packages/studio/src/player/components/TimelineClipDiamonds.tsx
+++ b/packages/studio/src/player/components/TimelineClipDiamonds.tsx
@@ -225,7 +225,7 @@ export const TimelineDiamondLane = memo(function TimelineDiamondLane({
isSelected && halfFramePct > 0
? nearestKeyframeWithin(sorted, currentPercentage, halfFramePct)
: null;
- const baseColor = isSelected ? accentColor : "#a3a3a3";
+ const baseColor = isSelected ? accentColor : "var(--timeline-diamond-muted)";
const baseOpacity = isSelected ? 0.4 : 0.25;
const canDrag = isSelected && !!onMoveKeyframe;
@@ -280,7 +280,7 @@ export const TimelineDiamondLane = memo(function TimelineDiamondLane({
const isKfSelected = selectedKeyframes.has(kfKey);
const atPlayhead = kf === playheadKeyframe;
const isHighlighted = isKfSelected || atPlayhead;
- const color = isKfSelected ? accentColor : "#a3a3a3";
+ const color = isKfSelected ? accentColor : "var(--timeline-diamond-muted)";
const onPointerDown = (e: React.PointerEvent<HTMLButtonElement>) => {
if (e.button !== 0) return;
diff --git a/packages/studio/src/player/components/TimelineDiamondConnectors.tsx b/packages/studio/src/player/components/TimelineDiamondConnectors.tsx
index 5e5fa4b2c7..77585875e6 100644
--- a/packages/studio/src/player/components/TimelineDiamondConnectors.tsx
+++ b/packages/studio/src/player/components/TimelineDiamondConnectors.tsx
@@ -213,8 +213,8 @@ function SegmentEaseControl({
zIndex: 3,
pointerEvents: "auto",
padding: 0,
- border: "1px solid rgba(255, 255, 255, 0.14)",
- background: "#171717",
+ border: "1px solid var(--timeline-diamond-border)",
+ background: "var(--timeline-diamond-bg)",
cursor: "pointer",
}}
onPointerDown={(e) => {
diff --git a/packages/studio/src/player/components/TimelineEmptyState.tsx b/packages/studio/src/player/components/TimelineEmptyState.tsx
index 1eb0aa88ae..8d99d3efab 100644
--- a/packages/studio/src/player/components/TimelineEmptyState.tsx
+++ b/packages/studio/src/player/components/TimelineEmptyState.tsx
@@ -18,7 +18,7 @@ export function TimelineEmptyState({
}: TimelineEmptyStateProps) {
return (
<div
- className={`h-full border-t bg-[#0a0a0b] flex flex-col select-none transition-colors duration-150 ${
+ className={`h-full border-t bg-[var(--timeline-shell-bg)] flex flex-col select-none transition-colors duration-150 ${
isDragOver ? "border-studio-accent/50 bg-studio-accent/3" : "border-neutral-800/50"
}`}
onDragOver={onDragOver}
diff --git a/packages/studio/src/player/components/TimelineFxButton.tsx b/packages/studio/src/player/components/TimelineFxButton.tsx
index e5fe543a21..f6e0ee894d 100644
--- a/packages/studio/src/player/components/TimelineFxButton.tsx
+++ b/packages/studio/src/player/components/TimelineFxButton.tsx
@@ -79,7 +79,7 @@ function GroupNameDialog({
<div
role="dialog"
aria-label="This track cannot be grouped"
- className="z-200 w-64 rounded-md border border-white/10 bg-[#1b1b1f] p-3 text-[11px] leading-snug text-white/75 shadow-xl"
+ className="z-200 w-64 rounded-md border border-[var(--timeline-tick-major)] bg-[var(--timeline-dialog-bg)] p-3 text-[11px] leading-snug text-[var(--timeline-text-soft)] shadow-xl"
style={{ position: "fixed", ...groupDialogPosition(anchorRect) }}
onPointerDown={(event) => event.stopPropagation()}
onKeyDown={(event) => {
@@ -97,7 +97,7 @@ function GroupNameDialog({
<div
role="dialog"
aria-label="Name this group"
- className="z-200 w-64 rounded-md border border-white/10 bg-[#1b1b1f] p-3 text-[11px] text-white/75 shadow-xl"
+ className="z-200 w-64 rounded-md border border-[var(--timeline-tick-major)] bg-[var(--timeline-dialog-bg)] p-3 text-[11px] text-[var(--timeline-text-soft)] shadow-xl"
style={{ position: "fixed", ...groupDialogPosition(anchorRect) }}
onPointerDown={(event) => event.stopPropagation()}
onKeyDown={(event) => {
@@ -108,14 +108,14 @@ function GroupNameDialog({
if (event.key === "Enter") confirm();
}}
>
- <p className="mb-1.5 font-medium text-white">Name this group</p>
+ <p className="mb-1.5 font-medium text-[var(--timeline-text-solid)]">Name this group</p>
<input
ref={inputRef}
type="text"
aria-label="Group name"
value={label}
onChange={(event) => setLabel(event.currentTarget.value)}
- className="w-full rounded-sm border border-white/20 bg-black/30 px-1.5 py-1 text-[11px] text-white outline-hidden focus:border-[#3CE6AC]"
+ className="w-full rounded-sm border border-[var(--timeline-border-strong)] bg-[var(--timeline-input-bg)] px-1.5 py-1 text-[11px] text-[var(--timeline-text-solid)] outline-hidden focus:border-[var(--timeline-accent)]"
/>
{/* The sentence. No jargon, and it names both things a bus does. */}
<p className="mt-2 leading-snug">
@@ -125,14 +125,14 @@ function GroupNameDialog({
<div className="mt-2.5 flex justify-end gap-1.5">
<button
type="button"
- className="rounded-sm border border-white/20 px-2 py-1 text-[10px] text-white/75 hover:bg-white/10"
+ className="rounded-sm border border-[var(--timeline-border-strong)] px-2 py-1 text-[10px] text-[var(--timeline-text-soft)] hover:bg-[var(--timeline-tick-major)]"
onClick={onCancel}
>
Cancel
</button>
<button
type="button"
- className="rounded-sm border border-[#3CE6AC] bg-[#3CE6AC]/15 px-2 py-1 text-[10px] font-semibold text-[#3CE6AC] hover:bg-[#3CE6AC]/25"
+ className="rounded-sm border border-[var(--timeline-accent)] bg-[var(--timeline-accent-button-bg)] px-2 py-1 text-[10px] font-semibold text-[var(--timeline-accent)] hover:bg-[var(--timeline-accent-hover)]"
onClick={confirm}
>
Group
@@ -212,7 +212,7 @@ export function TimelineFxButton(props: TimelineFxButtonProps) {
ref={buttonRef}
aria-label="Effects — group these clips first"
title="Group these clips to add effects to all of them"
- className="flex h-6 items-center justify-center rounded-sm border-0 bg-transparent px-1 text-[10px] font-semibold text-white/35 hover:text-white/75"
+ className="flex h-6 items-center justify-center rounded-sm border-0 bg-transparent px-1 text-[10px] font-semibold text-[var(--timeline-text-faint)] hover:text-[var(--timeline-text-soft)]"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
event.stopPropagation();
@@ -253,7 +253,9 @@ export function TimelineFxButton(props: TimelineFxButtonProps) {
aria-label={nodeCount > 0 ? `Effects — ${nodeCount} applied` : "Effects"}
title="Effects"
className={`flex h-6 items-center justify-center gap-0.5 rounded border-0 bg-transparent px-1 text-[10px] font-semibold transition-colors ${
- open || nodeCount > 0 ? "text-[#3CE6AC]" : "text-white/35 hover:text-white/75"
+ open || nodeCount > 0
+ ? "text-[var(--timeline-accent)]"
+ : "text-[var(--timeline-text-faint)] hover:text-[var(--timeline-text-soft)]"
}`}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
diff --git a/packages/studio/src/player/components/TimelineGroupHeader.tsx b/packages/studio/src/player/components/TimelineGroupHeader.tsx
index 02f653cf42..9241d59109 100644
--- a/packages/studio/src/player/components/TimelineGroupHeader.tsx
+++ b/packages/studio/src/player/components/TimelineGroupHeader.tsx
@@ -55,21 +55,24 @@ function GroupNameButton({
// No `flex-1`: the row's control group owns the slack now (`ml-auto`), so
// claiming it here would push the controls off the right edge — and the
// count with them, since it rides inside this button.
- className="flex h-6 min-w-0 items-center gap-1.5 rounded-sm border-0 bg-transparent p-0 text-left text-[11px] text-white hover:text-[#3CE6AC] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[#3CE6AC]"
+ className="flex h-6 min-w-0 items-center gap-1.5 rounded-sm border-0 bg-transparent p-0 text-left text-[11px] text-[var(--timeline-text-solid)] hover:text-[var(--timeline-accent)] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)]"
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
event.stopPropagation();
onOpenFxRack();
}}
>
- <span aria-hidden="true" className="shrink-0 text-[12px] leading-none text-white/50">
+ <span
+ aria-hidden="true"
+ className="shrink-0 text-[12px] leading-none text-[var(--timeline-track-label)]"
+ >
▤
</span>
<span title={label} className="min-w-0 truncate text-left font-medium leading-tight">
{label}
</span>
<span
- className="shrink-0 rounded-full bg-white/10 px-1 text-[9px] leading-[14px] tabular-nums text-white/55"
+ className="shrink-0 rounded-full bg-[var(--timeline-tick-major)] px-1 text-[9px] leading-[14px] tabular-nums text-[var(--timeline-handle)]"
aria-hidden="true"
title={`${memberCount} tracks`}
>
@@ -103,7 +106,7 @@ export function TimelineGroupHeader({
style={{
width: columnWidth,
height: TRACK_H,
- color: "#ffffff",
+ color: "var(--timeline-text-solid)",
background: theme.gutterBackground,
borderRight: `1px solid ${theme.gutterBorder}`,
}}
@@ -119,8 +122,10 @@ export function TimelineGroupHeader({
// 13px mono, matching the property panel's preset-run caret
// (`hf-fx-preset-run-caret`) — the same disclosure, so the same glyph
// at the same size rather than a smaller one unique to this row.
- className={`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 font-mono text-[13px] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${
- isExpanded ? "text-white" : "text-white/55 hover:text-white"
+ className={`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 font-mono text-[13px] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)] ${
+ isExpanded
+ ? "text-[var(--timeline-text-solid)]"
+ : "text-[var(--timeline-handle)] hover:text-[var(--timeline-text-solid)]"
}`}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
@@ -157,8 +162,10 @@ export function TimelineGroupHeader({
aria-label={`${isLaneOpen ? "Hide" : "Show"} ${label} lanes`}
title={`${isLaneOpen ? "Hide" : "Show"} lanes`}
// Anchored right, matching every other header's lane toggle.
- className={`ml-auto flex h-6 items-center justify-center gap-0.5 rounded border-0 bg-transparent px-1 text-[11px] leading-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[#3CE6AC] ${
- isLaneOpen ? "text-[#3CE6AC]" : "text-white/55 hover:text-white"
+ className={`ml-auto flex h-6 items-center justify-center gap-0.5 rounded border-0 bg-transparent px-1 text-[11px] leading-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)] ${
+ isLaneOpen
+ ? "text-[var(--timeline-accent)]"
+ : "text-[var(--timeline-handle)] hover:text-[var(--timeline-text-solid)]"
}`}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
@@ -167,7 +174,9 @@ export function TimelineGroupHeader({
}}
>
<span aria-hidden="true">∿</span>
- <span className="text-[9px] tabular-nums text-white/55">{laneCount}</span>
+ <span className="text-[9px] tabular-nums text-[var(--timeline-handle)]">
+ {laneCount}
+ </span>
</button>
)}
</div>
diff --git a/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx b/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx
index 5121657e87..89231d91e5 100644
--- a/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx
+++ b/packages/studio/src/player/components/TimelineGroupLaneLabels.tsx
@@ -64,7 +64,7 @@ export function TimelineGroupLaneLabels({
key={lane.target}
data-group-lane-label={lane.target}
aria-label={`Show ${groupLabel} ${parts.name}${parts.param ? ` ${parts.param}` : ""} in the effect rack`}
- className="absolute left-0 flex items-center gap-1.5 overflow-hidden border-0 px-1.5 text-left text-[10px] text-white/65 hover:text-white focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[#3CE6AC]"
+ className="absolute left-0 flex items-center gap-1.5 overflow-hidden border-0 px-1.5 text-left text-[10px] text-[var(--timeline-text-secondary)] hover:text-[var(--timeline-text-solid)] focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-[var(--timeline-accent)]"
style={{
top: top + index * AUTOMATION_LANE_H,
width: columnWidth,
@@ -79,16 +79,23 @@ export function TimelineGroupLaneLabels({
onReveal?.(lane.target);
}}
>
- <span aria-hidden="true" className="shrink-0 text-[11px] text-white/40">
+ <span
+ aria-hidden="true"
+ className="shrink-0 text-[11px] text-[var(--timeline-text-dim)]"
+ >
▤
</span>
<span className="flex min-w-0 flex-1 flex-col justify-center leading-tight">
- <span className="truncate font-mono text-[9px] text-white/70">{parts.name}</span>
+ <span className="truncate font-mono text-[9px] text-[var(--timeline-text-bright)]">
+ {parts.name}
+ </span>
{parts.param ? (
- <span className="truncate font-mono text-[9px] text-white/40">{parts.param}</span>
+ <span className="truncate font-mono text-[9px] text-[var(--timeline-text-dim)]">
+ {parts.param}
+ </span>
) : null}
</span>
- <span className="shrink-0 font-mono text-[9px] tabular-nums text-white/55">
+ <span className="shrink-0 font-mono text-[9px] tabular-nums text-[var(--timeline-handle)]">
{value.toFixed(2)}
</span>
</button>
diff --git a/packages/studio/src/player/components/TimelineGroupRow.tsx b/packages/studio/src/player/components/TimelineGroupRow.tsx
index 0e2c5db9be..615faf5011 100644
--- a/packages/studio/src/player/components/TimelineGroupRow.tsx
+++ b/packages/studio/src/player/components/TimelineGroupRow.tsx
@@ -21,7 +21,7 @@ import { usePlayerStore } from "../store/playerStore";
/** Accent rail on a group-owned lane — the same green the member rail uses, so
* "this belongs to the group" reads the same in both places (groups doc §5). */
-const GROUP_LANE_ACCENT = "#3CE6AC";
+const GROUP_LANE_ACCENT = "var(--timeline-accent)";
interface TimelineGroupRowProps {
index: number;
diff --git a/packages/studio/src/player/components/TimelinePropertyLanes.test.tsx b/packages/studio/src/player/components/TimelinePropertyLanes.test.tsx
index a3241a3790..9f44822e86 100644
--- a/packages/studio/src/player/components/TimelinePropertyLanes.test.tsx
+++ b/packages/studio/src/player/components/TimelinePropertyLanes.test.tsx
@@ -386,7 +386,7 @@ describe("TimelinePropertyLanes", () => {
const positionFill = laneDiamonds(host, "position")[0]?.querySelector("path:last-child");
const visualFill = laneDiamonds(host, "visual")[0]?.querySelector("path:last-child");
expect(positionFill?.getAttribute("fill")).toBe("#4ba3d2");
- expect(visualFill?.getAttribute("fill")).toBe("#a3a3a3");
+ expect(visualFill?.getAttribute("fill")).toBe("var(--timeline-diamond-muted)");
act(() => root.unmount());
});
diff --git a/packages/studio/src/player/components/TimelineRazorInteraction.tsx b/packages/studio/src/player/components/TimelineRazorInteraction.tsx
index 1d0d554b0b..3229b4aacf 100644
--- a/packages/studio/src/player/components/TimelineRazorInteraction.tsx
+++ b/packages/studio/src/player/components/TimelineRazorInteraction.tsx
@@ -54,7 +54,7 @@ export function TimelineRazorGuideOverlay({ x }: { x: number }) {
return (
<div
className="absolute top-0 bottom-0 pointer-events-none z-10"
- style={{ left: x, width: 1, background: "rgba(239,68,68,0.7)" }}
+ style={{ left: x, width: 1, background: "var(--timeline-danger)" }}
/>
);
}
diff --git a/packages/studio/src/player/components/TimelineRuler.tsx b/packages/studio/src/player/components/TimelineRuler.tsx
index 58895d9eb5..b3fcd83bab 100644
--- a/packages/studio/src/player/components/TimelineRuler.tsx
+++ b/packages/studio/src/player/components/TimelineRuler.tsx
@@ -69,7 +69,8 @@ export const TimelineRuler = memo(function TimelineRuler({
y1={0}
x2={x}
y2={totalH}
- stroke={`rgba(34, 197, 94, ${opacity.toFixed(3)})`}
+ stroke="var(--timeline-beat)"
+ strokeOpacity={opacity}
strokeWidth="1"
/>
);
@@ -99,7 +100,7 @@ export const TimelineRuler = memo(function TimelineRuler({
style={{
height: RULER_H,
width: trackContentWidth,
- // Ruler background = panel surface (#0A0A0B) — no bottom border,
+ // Ruler background = the panel surface token — no bottom border,
// no tick lines (CapCut-style clean ruler, labels only).
background: theme.shellBackground,
}}
diff --git a/packages/studio/src/player/components/TimelineShortcutHint.tsx b/packages/studio/src/player/components/TimelineShortcutHint.tsx
index be06843502..252586b615 100644
--- a/packages/studio/src/player/components/TimelineShortcutHint.tsx
+++ b/packages/studio/src/player/components/TimelineShortcutHint.tsx
@@ -9,11 +9,11 @@ export function TimelineShortcutHint({ theme }: TimelineShortcutHintProps) {
<div className="absolute bottom-2 right-3 pointer-events-none z-20">
<div
className="flex items-center gap-1.5 px-2 py-1 rounded-md border"
- style={{ background: "rgba(17,23,35,0.84)", borderColor: theme.gutterBorder }}
+ style={{ background: "var(--timeline-shortcut-bg)", borderColor: theme.gutterBorder }}
>
<kbd
className="text-[9px] font-mono px-1 py-0.5 rounded-sm"
- style={{ color: theme.textSecondary, background: "rgba(255,255,255,0.06)" }}
+ style={{ color: theme.textSecondary, background: "var(--timeline-tick-minor)" }}
>
Shift
</kbd>
diff --git a/packages/studio/src/player/components/TimelineTrackHeader.test.tsx b/packages/studio/src/player/components/TimelineTrackHeader.test.tsx
index a8f6da7ead..ba40ffcb40 100644
--- a/packages/studio/src/player/components/TimelineTrackHeader.test.tsx
+++ b/packages/studio/src/player/components/TimelineTrackHeader.test.tsx
@@ -793,7 +793,7 @@ describe("TimelineTrackHeader", () => {
isGroupMember: true,
});
expect(header()?.style.paddingLeft).toBe("14px");
- expect(header()?.style.borderLeft).toContain("2px");
+ expect(header()?.style.borderLeft).toContain("var(--timeline-accent-rail)");
act(() => view.root.unmount());
});
diff --git a/packages/studio/src/player/components/TimelineTrackHeader.tsx b/packages/studio/src/player/components/TimelineTrackHeader.tsx
index ced3683eb3..8ff70cc4c7 100644
--- a/packages/studio/src/player/components/TimelineTrackHeader.tsx
+++ b/packages/studio/src/player/components/TimelineTrackHeader.tsx
@@ -26,12 +26,10 @@ import { useMemo } from "react";
/** Accent rail + inset marking a row as a group MEMBER, matching the level-2
* nesting its `aria-level` already reports. */
-const GROUP_MEMBER_RAIL = "#3CE6AC59";
+const GROUP_MEMBER_RAIL = "var(--timeline-accent-rail)";
const GROUP_MEMBER_INDENT = 14;
-/** A hair lighter than `gutterBackground`, so a member row reads as sitting
- * INSIDE its group rather than beside it. Overlaid rather than hard-coded so
- * it tracks whatever the theme's gutter is. */
-const GROUP_MEMBER_TINT = "rgba(255,255,255,0.035)";
+/** A neutral wash keeps group membership visible without changing the row's hue. */
+const GROUP_MEMBER_TINT = "var(--timeline-group-member-tint)";
/** The gutter fill for a row, tinted when it belongs to a group. */
export function gutterFill(base: string, isGroupMember: boolean): string {
@@ -288,7 +286,7 @@ export function TimelineTrackHeader({
<div
className={
showTrackLabel
- ? "flex flex-col justify-center gap-0.5 px-1.5 text-white/55"
+ ? "flex flex-col justify-center gap-0.5 px-1.5 text-[var(--timeline-handle)]"
: "flex flex-col items-center justify-center gap-0.5"
}
style={{ height: TRACK_H }}
diff --git a/packages/studio/src/player/components/TimelineTrackPlainHeader.tsx b/packages/studio/src/player/components/TimelineTrackPlainHeader.tsx
index 02661a3621..1f506c8ecf 100644
--- a/packages/studio/src/player/components/TimelineTrackPlainHeader.tsx
+++ b/packages/studio/src/player/components/TimelineTrackPlainHeader.tsx
@@ -39,8 +39,10 @@ export function VisibilityButton({
type="button"
aria-label={label}
title={label}
- className={`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 transition-colors focus-visible:outline-solid focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-[#3CE6AC] ${
- hidden ? "text-[#3CE6AC] hover:text-white" : "text-white/35 hover:text-white/75"
+ className={`flex h-6 w-6 shrink-0 items-center justify-center rounded border-0 bg-transparent p-0 transition-colors focus-visible:outline-solid focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-[var(--timeline-accent)] ${
+ hidden
+ ? "text-[var(--timeline-accent)] hover:text-[var(--timeline-text-solid)]"
+ : "text-[var(--timeline-text-faint)] hover:text-[var(--timeline-text-soft)]"
}`}
onPointerDown={(event) => event.stopPropagation()}
onClick={(event) => {
@@ -89,7 +91,12 @@ export function PlainTrackHeader({
and the name gives way instead. */}
<div className="flex min-w-0 items-center gap-1">
{isAudioTrack && (
- <Music size={12} weight="fill" aria-hidden="true" className="text-white/35" />
+ <Music
+ size={12}
+ weight="fill"
+ aria-hidden="true"
+ className="text-[var(--timeline-text-faint)]"
+ />
)}
{/* No `flex-1`: the name takes only the width it needs, so the clip
count sits against it rather than being pushed out to meet the
diff --git a/packages/studio/src/player/components/VideoThumbnail.tsx b/packages/studio/src/player/components/VideoThumbnail.tsx
index 8317ab1a0f..755daf0e03 100644
--- a/packages/studio/src/player/components/VideoThumbnail.tsx
+++ b/packages/studio/src/player/components/VideoThumbnail.tsx
@@ -112,8 +112,7 @@ export const VideoThumbnail = memo(function VideoThumbnail({
<div
className="absolute inset-0 animate-pulse motion-reduce:animate-none"
style={{
- background:
- "linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%)",
+ background: "var(--timeline-thumbnail-shimmer)",
}}
/>
)}
@@ -128,13 +127,12 @@ export const VideoThumbnail = memo(function VideoThumbnail({
<div
className="absolute inset-x-0 bottom-0 z-10 px-1.5 pb-0.5 pt-3"
style={{
- background:
- "linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%)",
+ background: "var(--timeline-thumbnail-label-gradient)",
}}
>
<span
className="block truncate text-[9px] font-semibold leading-tight"
- style={{ color: labelColor, textShadow: "0 1px 2px rgba(0,0,0,0.9)" }}
+ style={{ color: labelColor, textShadow: "var(--timeline-thumbnail-label-shadow)" }}
>
{label}
</span>
diff --git a/packages/studio/src/player/components/timelineMotionStyles.test.ts b/packages/studio/src/player/components/timelineMotionStyles.test.ts
index e49b1d9505..d23e163137 100644
--- a/packages/studio/src/player/components/timelineMotionStyles.test.ts
+++ b/packages/studio/src/player/components/timelineMotionStyles.test.ts
@@ -2,6 +2,14 @@ import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const studioCss = readFileSync(new URL("../../styles/studio.css", import.meta.url), "utf8");
+const themeCss = readFileSync(new URL("../../styles/theme.css", import.meta.url), "utf8");
+const timelineOverlaySources = [
+ "TimelineShortcutHint.tsx",
+ "LayerDisclosureRow.tsx",
+ "ImageThumbnail.tsx",
+ "AudioWaveform.tsx",
+ "VideoThumbnail.tsx",
+].map((fileName) => readFileSync(new URL(`./${fileName}`, import.meta.url), "utf8"));
const timelineClipSource = readFileSync(new URL("./TimelineClip.tsx", import.meta.url), "utf8");
const playheadSource = readFileSync(new URL("./PlayheadIndicator.tsx", import.meta.url), "utf8");
@@ -52,7 +60,26 @@ function transitionProperties(transitionDeclaration: string): string[] {
return items.map((transition) => transition.split(/\s+/)[0]);
}
+function themeTokenValue(token: string): string {
+ const match = new RegExp(`${token}:\\s*([^;]+);`).exec(themeCss);
+ expect(match?.[1]).toBeDefined();
+ return match?.[1].trim() ?? "";
+}
+
describe("timeline motion styles", () => {
+ it.each([
+ ["--timeline-track-label", "rgba(255, 255, 255, 0.5)"],
+ ["--timeline-tick-text", "rgba(255, 255, 255, 0.34)"],
+ ["--timeline-border-strong", "rgba(255, 255, 255, 0.2)"],
+ ["--timeline-group-member-tint", "rgba(255, 255, 255, 0.035)"],
+ ["--timeline-overlay-text", "rgba(255, 255, 255, 0.8)"],
+ ["--timeline-clip-shadow-dragging", "rgba(0, 0, 0, 0.4)"],
+ ["--timeline-playhead-glow", "rgba(60, 230, 172, 0.14)"],
+ ["--timeline-playhead-shadow", "rgba(0, 0, 0, 0.55)"],
+ ])("keeps the migrated default for %s", (token, expected) => {
+ expect(themeTokenValue(token)).toBe(expected);
+ });
+
it("keeps clip motion reduced-motion gated and layout safe", () => {
const mediaStart = studioCss.indexOf("@media (prefers-reduced-motion: no-preference)");
expect(mediaStart).toBeGreaterThanOrEqual(0);
@@ -71,11 +98,43 @@ describe("timeline motion styles", () => {
it("layers the active mint bloom through opacity instead of a gradient background swap", () => {
const baseTimelineClipRule = expectRule(studioCss, ".timeline-clip");
+ const timelineClipLabelRule = expectRule(studioCss, ".timeline-clip__label");
+ const activeTimelineClipLabelRule = expectRule(
+ studioCss,
+ ".timeline-clip[data-active] .timeline-clip__label",
+ );
+ const timelineClipTimecodeRule = expectRule(studioCss, ".timeline-clip__timecode");
+ const audioClipRule = expectRule(studioCss, ".timeline-clip.is-audio");
+ const audioClipHoverRule = expectRule(studioCss, ".timeline-clip.is-audio.is-hovered");
+ const audioClipDraggingRule = expectRule(studioCss, ".timeline-clip.is-audio.is-dragging");
const activeTimelineClipRule = expectRule(studioCss, ".timeline-clip[data-active]");
const bloomOverlayRule = expectRule(studioCss, ".timeline-clip::before");
const activeBloomOverlayRule = expectRule(studioCss, ".timeline-clip[data-active]::before");
expect(baseTimelineClipRule).toContain("background-color: var(--clip-bg)");
+ expect(baseTimelineClipRule).toContain("border: 1px solid var(--clip-border)");
+ expect(timelineClipLabelRule).toContain("color: var(--timeline-track-label)");
+ expect(timelineClipLabelRule).toContain("text-shadow: var(--timeline-clip-label-shadow)");
+ expect(timelineClipTimecodeRule).toContain("color: var(--timeline-tick-text)");
+ expect(activeTimelineClipLabelRule).toContain("color: var(--timeline-clip-label-active)");
+ expect(themeCss).toContain("--timeline-clip-bg: rgba(255, 255, 255, 0.12)");
+ expect(themeCss).toContain("--timeline-clip-border: rgba(255, 255, 255, 0.22)");
+ expect(themeCss).toContain("--timeline-track-label: rgba(255, 255, 255, 0.5)");
+ expect(themeCss).toContain("--timeline-tick-text: rgba(255, 255, 255, 0.34)");
+ expect(themeCss).toContain("--timeline-clip-label-active: rgba(232, 255, 247, 0.95)");
+ expect(themeCss).toContain("--timeline-clip-label-shadow: 0 1px 2px rgba(0, 0, 0, 0.85)");
+ expect(themeCss).toContain("--timeline-clip-selection: rgba(255, 255, 255, 0.85)");
+ expect(themeCss).toContain("--timeline-clip-audio-bg: rgba(167, 139, 250, 0.16)");
+ expect(themeCss).toContain("--timeline-clip-audio-border: rgba(167, 139, 250, 0.4)");
+ expect(themeCss).toContain("--timeline-clip-audio-bg-hover: rgba(167, 139, 250, 0.24)");
+ expect(themeCss).toContain("--timeline-clip-audio-bg-dragging: rgba(60, 52, 84, 0.96)");
+ expect(audioClipRule).toContain("background-color: var(--timeline-clip-audio-bg)");
+ expect(audioClipRule).toContain("border-color: var(--timeline-clip-audio-border)");
+ expect(audioClipHoverRule).toContain("background-color: var(--timeline-clip-audio-bg-hover)");
+ expect(audioClipDraggingRule).toContain(
+ "background-color: var(--timeline-clip-audio-bg-dragging)",
+ );
+ expect(studioCss).toContain("box-shadow: 0 0 0 1.5px var(--timeline-clip-selection)");
expect(activeTimelineClipRule).not.toContain("background: linear-gradient");
expect(activeTimelineClipRule).toContain("border-color: var(--clip-border-active)");
expect(activeTimelineClipRule).not.toContain("box-shadow");
@@ -85,6 +144,20 @@ describe("timeline motion styles", () => {
expect(activeBloomOverlayRule).toContain("opacity: 1");
});
+ it("routes timeline overlay colours through theme tokens", () => {
+ const overlaySource = timelineOverlaySources.join("\n");
+
+ expect(overlaySource).toContain("var(--timeline-shortcut-bg)");
+ expect(overlaySource).toContain("var(--timeline-thumbnail-shimmer)");
+ expect(overlaySource).toContain("var(--timeline-thumbnail-label-gradient)");
+ expect(overlaySource).toContain("var(--timeline-thumbnail-label-shadow)");
+ expect(overlaySource).toContain('"--timeline-waveform-bar-rgb"');
+ expect(overlaySource).toContain("var(--timeline-waveform-error)");
+ expect(overlaySource).toContain("var(--timeline-waveform-label-shadow)");
+ expect(overlaySource).toContain("var(--timeline-text-solid)");
+ expect(overlaySource).toContain("var(--timeline-accent)");
+ });
+
it("targets trim handle bars without changing drag geometry", () => {
const handleClassMatches = timelineClipSource.match(/className="timeline-clip__handle-bar"/g);
diff --git a/packages/studio/src/player/components/timelineTheme.ts b/packages/studio/src/player/components/timelineTheme.ts
index 6ba07b6292..09fe99ec09 100644
--- a/packages/studio/src/player/components/timelineTheme.ts
+++ b/packages/studio/src/player/components/timelineTheme.ts
@@ -27,10 +27,6 @@ export interface TimelineTheme {
clipBorder: string;
clipBorderHover: string;
clipBorderActive: string;
- clipShadow: string;
- clipShadowHover: string;
- clipShadowActive: string;
- clipShadowDragging: string;
handleColor: string;
panelResizeSeam: string;
panelResizeActive: string;
@@ -67,12 +63,6 @@ export const defaultTimelineTheme: TimelineTheme = {
clipBorder: "var(--timeline-clip-border)",
clipBorderHover: "var(--timeline-clip-border-hover)",
clipBorderActive: "var(--timeline-clip-border-active)",
- // Shadows stay literal: a light host still wants a dark contact shadow, so
- // these are not part of the surface/hairline/text/clip-colour theming ask.
- clipShadow: "none",
- clipShadowHover: "0 2px 8px rgba(0,0,0,0.2)",
- clipShadowActive: "0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04)",
- clipShadowDragging: "0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.06)",
handleColor: "var(--timeline-handle)",
panelResizeSeam: "var(--timeline-resize-seam)",
panelResizeActive: "var(--timeline-resize-active)",
diff --git a/packages/studio/src/styles/hex-baseline.json b/packages/studio/src/styles/hex-baseline.json
index 2ae279c532..8154e4bfeb 100644
--- a/packages/studio/src/styles/hex-baseline.json
+++ b/packages/studio/src/styles/hex-baseline.json
@@ -1,5 +1,5 @@
{
- "total": 385,
+ "total": 302,
"files": {
"packages/studio/src/captions/components/CaptionOverlay.tsx": 5,
"packages/studio/src/captions/components/CaptionTimeline.tsx": 11,
@@ -49,35 +49,16 @@
"packages/studio/src/components/sidebar/AudioRow.tsx": 2,
"packages/studio/src/components/ui/HyperframesMark.tsx": 4,
"packages/studio/src/hooks/useInlineTextEdit.ts": 1,
- "packages/studio/src/player/components/AudioWaveform.tsx": 6,
+ "packages/studio/src/player/components/AudioWaveform.tsx": 1,
"packages/studio/src/player/components/BeatStrip.tsx": 6,
"packages/studio/src/player/components/CompositionThumbnail.tsx": 2,
- "packages/studio/src/player/components/ImageThumbnail.tsx": 6,
- "packages/studio/src/player/components/LayerDisclosureRow.tsx": 3,
"packages/studio/src/player/components/Player.tsx": 2,
"packages/studio/src/player/components/PlayerControls.tsx": 1,
- "packages/studio/src/player/components/PlayheadIndicator.tsx": 3,
"packages/studio/src/player/components/ShortcutsPanel.tsx": 7,
"packages/studio/src/player/components/SpeedMenu.tsx": 2,
- "packages/studio/src/player/components/TimelineAutomationLane.tsx": 4,
- "packages/studio/src/player/components/TimelineCanvas.tsx": 13,
- "packages/studio/src/player/components/TimelineClipDiamonds.tsx": 2,
- "packages/studio/src/player/components/TimelineDiamondConnectors.tsx": 2,
- "packages/studio/src/player/components/TimelineEmptyState.tsx": 1,
- "packages/studio/src/player/components/TimelineFxButton.tsx": 8,
- "packages/studio/src/player/components/TimelineGroupHeader.tsx": 6,
- "packages/studio/src/player/components/TimelineGroupLaneLabels.tsx": 1,
- "packages/studio/src/player/components/TimelineGroupRow.tsx": 1,
- "packages/studio/src/player/components/TimelineRazorInteraction.tsx": 1,
- "packages/studio/src/player/components/TimelineRuler.tsx": 1,
- "packages/studio/src/player/components/TimelineShortcutHint.tsx": 2,
- "packages/studio/src/player/components/TimelineTrackHeader.tsx": 2,
- "packages/studio/src/player/components/TimelineTrackPlainHeader.tsx": 2,
- "packages/studio/src/player/components/VideoThumbnail.tsx": 6,
- "packages/studio/src/player/components/timelineTheme.ts": 5,
"packages/studio/src/player/components/trackHeaderLabelRows.tsx": 6,
- "packages/studio/src/styles/studio.css": 63,
"packages/studio/src/telemetry/client.ts": 1,
- "packages/studio/src/webmcp/webmcpTestUtils.ts": 1
+ "packages/studio/src/webmcp/webmcpTestUtils.ts": 1,
+ "packages/studio/src/styles/studio.css": 48
}
}
diff --git a/packages/studio/src/styles/studio.css b/packages/studio/src/styles/studio.css
index 54aa2262ca..7cecf30410 100644
--- a/packages/studio/src/styles/studio.css
+++ b/packages/studio/src/styles/studio.css
@@ -227,16 +227,16 @@ body {
accented visual clips — so the audio zone at the bottom is visually separate
at a glance (the timeline's kinds: visual on top, audio below). */
.timeline-clip.is-audio {
- background-color: rgba(167, 139, 250, 0.16);
- border-color: rgba(167, 139, 250, 0.4);
+ background-color: var(--timeline-clip-audio-bg);
+ border-color: var(--timeline-clip-audio-border);
}
.timeline-clip.is-audio.is-hovered {
- background-color: rgba(167, 139, 250, 0.24);
+ background-color: var(--timeline-clip-audio-bg-hover);
}
.timeline-clip.is-audio.is-dragging {
- background-color: rgba(60, 52, 84, 0.96);
+ background-color: var(--timeline-clip-audio-bg-dragging);
}
.timeline-clip.is-hovered {
@@ -248,32 +248,32 @@ body {
}
.timeline-clip.is-selected {
- box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
+ box-shadow: 0 0 0 1.5px var(--timeline-clip-selection);
}
.timeline-clip[data-active].is-selected {
- box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
+ box-shadow: 0 0 0 1.5px var(--timeline-clip-selection);
}
.timeline-clip.is-dragging {
/* Solid background so the picked-up clip reads clearly while dragging — audio
clips (waveform drawn on a separate layer) would otherwise look transparent. */
background-color: var(--clip-bg-dragging);
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
+ box-shadow: 0 8px 24px var(--timeline-clip-shadow-dragging);
}
/* Keep the white selection outline while dragging (a plain box-shadow alone gets
overridden by .is-dragging's drop shadow, so re-state both together). */
.timeline-clip.is-selected.is-dragging {
box-shadow:
- 0 0 0 1.5px rgba(255, 255, 255, 0.85),
- 0 8px 24px rgba(0, 0, 0, 0.4);
+ 0 0 0 1.5px var(--timeline-clip-selection),
+ 0 8px 24px var(--timeline-clip-shadow-dragging);
}
.timeline-clip[data-active].is-selected.is-dragging {
box-shadow:
- 0 0 0 1.5px rgba(255, 255, 255, 0.85),
- 0 8px 24px rgba(0, 0, 0, 0.4);
+ 0 0 0 1.5px var(--timeline-clip-selection),
+ 0 8px 24px var(--timeline-clip-shadow-dragging);
}
.timeline-clip__label {
@@ -283,18 +283,18 @@ body {
right: 10px;
z-index: 6;
overflow: hidden;
- color: rgba(255, 255, 255, 0.5);
+ color: var(--timeline-track-label);
font-size: 10px;
font-weight: 500;
line-height: 1;
pointer-events: none;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
+ text-shadow: var(--timeline-clip-label-shadow);
text-overflow: ellipsis;
white-space: nowrap;
}
.timeline-clip[data-active] .timeline-clip__label {
- color: rgba(232, 255, 247, 0.95);
+ color: var(--timeline-clip-label-active);
}
.timeline-clip__timecode {
@@ -302,7 +302,7 @@ body {
bottom: 6px;
left: 12px;
overflow: hidden;
- color: rgba(255, 255, 255, 0.34);
+ color: var(--timeline-tick-text);
font-family: var(--font-mono);
font-size: 9px;
font-variant-numeric: tabular-nums;
diff --git a/packages/studio/src/styles/theme.css b/packages/studio/src/styles/theme.css
index 2a5324e14c..80434050ad 100644
--- a/packages/studio/src/styles/theme.css
+++ b/packages/studio/src/styles/theme.css
@@ -62,6 +62,34 @@
--timeline-tick-major: rgba(255, 255, 255, 0.1);
--timeline-tick-minor: rgba(255, 255, 255, 0.06);
--timeline-clip-bg: rgba(255, 255, 255, 0.12);
+ --timeline-clip-label-active: rgba(232, 255, 247, 0.95);
+ --timeline-clip-label-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
+ --timeline-clip-audio-bg: rgba(167, 139, 250, 0.16);
+ --timeline-clip-audio-border: rgba(167, 139, 250, 0.4);
+ --timeline-clip-audio-bg-hover: rgba(167, 139, 250, 0.24);
+ --timeline-clip-audio-bg-dragging: rgba(60, 52, 84, 0.96);
+ --timeline-clip-selection: rgba(255, 255, 255, 0.85);
+ --timeline-shortcut-bg: rgba(17, 23, 35, 0.84);
+ --timeline-thumbnail-shimmer: linear-gradient(
+ 90deg,
+ rgba(255, 255, 255, 0.02) 0%,
+ rgba(255, 255, 255, 0.05) 50%,
+ rgba(255, 255, 255, 0.02) 100%
+ );
+ --timeline-thumbnail-label-gradient: linear-gradient(
+ to top,
+ rgba(0, 0, 0, 0.85) 0%,
+ rgba(0, 0, 0, 0.4) 60%,
+ transparent 100%
+ );
+ --timeline-thumbnail-label-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
+ --timeline-waveform-bar-rgb: 75, 163, 210;
+ --timeline-waveform-error: repeating-linear-gradient(
+ 90deg,
+ rgba(75, 163, 210, 0.35) 0 2px,
+ transparent 2px 5px
+ );
+ --timeline-waveform-label-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
--timeline-clip-bg-active: rgba(60, 230, 172, 0.2);
--timeline-clip-bg-hover: rgba(255, 255, 255, 0.16);
--timeline-clip-bg-dragging: rgba(38, 42, 52, 0.96);
@@ -78,6 +106,40 @@
--timeline-track-clip-fill: rgba(255, 255, 255, 0.055);
--timeline-track-clip-active: rgba(60, 230, 172, 0.16);
--timeline-track-label: rgba(255, 255, 255, 0.5);
+ --timeline-border-strong: rgba(255, 255, 255, 0.2);
+ --timeline-group-member-tint: rgba(255, 255, 255, 0.035);
+ --timeline-overlay-text: rgba(255, 255, 255, 0.8);
+ --timeline-accent: #3ce6ac;
+ --timeline-accent-soft: rgba(60, 230, 172, 0.18);
+ --timeline-accent-faint: rgba(60, 230, 172, 0.055);
+ --timeline-accent-fill: rgba(60, 230, 172, 0.1);
+ --timeline-accent-glow: rgba(60, 230, 172, 0.5);
+ --timeline-accent-border: rgba(60, 230, 172, 0.7);
+ --timeline-accent-rail: rgba(60, 230, 172, 0.35);
+ --timeline-accent-hover: rgba(60, 230, 172, 0.25);
+ --timeline-accent-button-bg: rgba(60, 230, 172, 0.15);
+ --timeline-danger: rgba(239, 68, 68, 0.7);
+ --timeline-info-bg: rgba(59, 130, 246, 0.12);
+ --timeline-info-border: rgba(59, 130, 246, 0.4);
+ --timeline-dialog-bg: #1b1b1f;
+ --timeline-diamond-bg: #171717;
+ --timeline-diamond-border: rgba(255, 255, 255, 0.14);
+ --timeline-text-solid: #ffffff;
+ --timeline-text-faint: rgba(255, 255, 255, 0.35);
+ --timeline-text-dim: rgba(255, 255, 255, 0.4);
+ --timeline-text-soft: rgba(255, 255, 255, 0.75);
+ --timeline-text-bright: rgba(255, 255, 255, 0.7);
+ --timeline-snap-guide: rgba(255, 255, 255, 0.6);
+ --timeline-overlay-bg: rgba(0, 0, 0, 0.8);
+ --timeline-overlay-bg-strong: rgba(0, 0, 0, 0.85);
+ --timeline-input-bg: rgba(0, 0, 0, 0.3);
+ --timeline-automation-rail: rgba(255, 255, 255, 0.08);
+ --timeline-automation-point-muted: rgba(0, 0, 0, 0.5);
+ --timeline-diamond-muted: #a3a3a3;
+ --timeline-beat: rgb(34, 197, 94);
+ --timeline-clip-shadow-dragging: rgba(0, 0, 0, 0.4);
+ --timeline-playhead-glow: rgba(60, 230, 172, 0.14);
+ --timeline-playhead-shadow: rgba(0, 0, 0, 0.55);
/* -------------------------------------------------------------- geometry */