🎥 Make videos programmatically with React
`@remotion/studio`: Move color palette to CSS variables
Jonny Burgerdc0251a04a62
diff --git a/packages/studio/src/Studio.tsx b/packages/studio/src/Studio.tsxindex 524390589f..a06fe5f335 100644--- a/packages/studio/src/Studio.tsx+++ b/packages/studio/src/Studio.tsx@@ -7,6 +7,7 @@ import {ServerDisconnected} from './components/Notifications/ServerDisconnected'import {StaticFilesProvider} from './components/use-static-files';import {FastRefreshProvider} from './FastRefreshProvider';import {injectCSS} from './helpers/inject-css';+import {studioCssVariables} from './helpers/studio-css-variables';import {ResolveCompositionConfigInStudio} from './ResolveCompositionConfigInStudio';import {CompositionListProvider} from './state/composition-list';@@ -73,6 +74,7 @@ export const Studio: React.FC<{return (<FastRefreshProvider>+ <style>{studioCssVariables}</style><StudioInner rootComponent={rootComponent} readOnly={readOnly} /></FastRefreshProvider>);diff --git a/packages/studio/src/components/AudioWaveform.tsx b/packages/studio/src/components/AudioWaveform.tsxindex 09b5b02697..d3ba02b954 100644--- a/packages/studio/src/components/AudioWaveform.tsx+++ b/packages/studio/src/components/AudioWaveform.tsx@@ -10,6 +10,7 @@ import type {LoopDisplay} from 'remotion';import {Internals} from 'remotion';import {WHITE_ALPHA_70, WHITE_ALPHA_60} from '../helpers/colors';import {TIMELINE_FRAME_WIDTH_AT_MAX_ZOOM} from '../helpers/get-timeline-max-zoom';+import {resolveStudioColor} from '../helpers/resolve-studio-color';import {TIMELINE_BORDER} from '../helpers/timeline-layout';const EMPTY_PEAKS = new Float32Array(0);@@ -169,7 +170,10 @@ const AudioWaveformInner: React.FC<{drawBars({canvas: canvasElement,peaks: portionPeaks ?? EMPTY_PEAKS,- color: WHITE_ALPHA_60,+ color: resolveStudioColor(+ WHITE_ALPHA_60,+ getComputedStyle(canvasElement),+ ),volume: visibleVolume,width: drawingWidth,});@@ -218,7 +222,10 @@ const AudioWaveformInner: React.FC<{context.lineTo(x, y);}});- context.strokeStyle = WHITE_ALPHA_70;+ context.strokeStyle = resolveStudioColor(+ WHITE_ALPHA_70,+ getComputedStyle(volumeCanvasElement),+ );context.lineWidth = pixelRatio;context.stroke();}, [height, shouldRenderVolumeOverlay, visibleVolume, visualizationWidth]);diff --git a/packages/studio/src/components/CodeFrame.tsx b/packages/studio/src/components/CodeFrame.tsxindex fe799b2c9c..8acebb6ccc 100644--- a/packages/studio/src/components/CodeFrame.tsx+++ b/packages/studio/src/components/CodeFrame.tsx@@ -3,6 +3,7 @@ import React from 'react';import {ERROR_CODE_FRAME_BACKGROUND,ERROR_CODE_FRAME_LINE_BACKGROUND,+ PRISM_VARIABLE_COLOR,SELECTED_BACKGROUND,TRANSPARENT,WHITE,@@ -101,7 +102,7 @@ export const CodeFrame: React.FC<{display: 'block',fontFamily: 'monospace',fontSize,- color: '#9cdcfe',+ color: PRISM_VARIABLE_COLOR,whiteSpace: 'pre',tabSize: 2,backgroundColor: TRANSPARENT,diff --git a/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSectionHeader.tsx b/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSectionHeader.tsxindex e8a8b1c280..61720779a3 100644--- a/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSectionHeader.tsx+++ b/packages/studio/src/components/InspectorPanel/CollapsibleInspectorSectionHeader.tsx@@ -33,7 +33,7 @@ const staticSectionTitle: React.CSSProperties = {const collapsibleSectionHeaderButton: React.CSSProperties = {...sectionTitle,appearance: 'none',- backgroundColor: 'transparent',+ backgroundColor: TRANSPARENT,border: 'none',borderRadius: 3,cursor: 'default',diff --git a/packages/studio/src/components/KeyboardShortcutsSettings.tsx b/packages/studio/src/components/KeyboardShortcutsSettings.tsxindex 1672dde800..61404ef22a 100644--- a/packages/studio/src/components/KeyboardShortcutsSettings.tsx+++ b/packages/studio/src/components/KeyboardShortcutsSettings.tsx@@ -19,6 +19,7 @@ import {BORDER_WHITE_ALPHA_12,INPUT_BACKGROUND,LIGHT_TEXT,+ TRANSPARENT,WHITE,} from '../helpers/colors';import {canEditStudioConfig} from '../helpers/settings-tab-availability';@@ -128,7 +129,7 @@ const key: React.CSSProperties = {const chordButton: React.CSSProperties = {alignItems: 'center',- background: 'transparent',+ background: TRANSPARENT,border: 0,cursor: 'pointer',display: 'flex',diff --git a/packages/studio/src/components/NewComposition/InputDragger.tsx b/packages/studio/src/components/NewComposition/InputDragger.tsxindex cca796f3c3..f70cf0a56b 100644--- a/packages/studio/src/components/NewComposition/InputDragger.tsx+++ b/packages/studio/src/components/NewComposition/InputDragger.tsx@@ -5,7 +5,7 @@ import type {} from 'react';import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';import {interpolate} from 'remotion';-import {BLUE, TRANSPARENT} from '../../helpers/colors';+import {BLUE, BLUE_HOVERED, TRANSPARENT} from '../../helpers/colors';import {noop} from '../../helpers/noop';import {isPointerSessionRelease,@@ -531,7 +531,7 @@ const InputDraggerForwardRefFn: React.ForwardRefRenderFunction<const span: React.CSSProperties = useMemo(() => ({- color: dragging ? 'var(--remotion-cli-internals-blue-hovered)' : BLUE,+ color: dragging ? BLUE_HOVERED : BLUE,cursor: 'ew-resize',userSelect: 'none',WebkitUserSelect: 'none',diff --git a/packages/studio/src/components/RenderModal/SchemaEditor/create-zod-values.ts b/packages/studio/src/components/RenderModal/SchemaEditor/create-zod-values.tsindex 7435f25471..08d85c4e54 100644--- a/packages/studio/src/components/RenderModal/SchemaEditor/create-zod-values.ts+++ b/packages/studio/src/components/RenderModal/SchemaEditor/create-zod-values.ts@@ -1,4 +1,3 @@-import {WHITE_FULL_HEX} from '../../../helpers/colors';import type {ZodTypesType} from '../../get-zod-if-possible';import {type AnyZodSchema,@@ -38,7 +37,7 @@ export const createZodValues = (const description = getZodSchemaDescription(schema);if (zodTypes) {if (description === zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {- return WHITE_FULL_HEX;+ return '#ffffff';}if (description === zodTypes.ZodZypesInternals.REMOTION_TEXTAREA_BRAND) {diff --git a/packages/studio/src/components/RenderModal/WebRenderModalPicture.tsx b/packages/studio/src/components/RenderModal/WebRenderModalPicture.tsxindex 06f424d5eb..62dc850857 100644--- a/packages/studio/src/components/RenderModal/WebRenderModalPicture.tsx+++ b/packages/studio/src/components/RenderModal/WebRenderModalPicture.tsx@@ -1,7 +1,6 @@import type {WebRendererQuality} from '@remotion/web-renderer';import type React from 'react';import {useCallback, useMemo} from 'react';-import {TRANSPARENT} from '../../helpers/colors';import {Checkbox} from '../Checkbox';import {Combobox} from '../NewComposition/ComboBox';import {label, optionRow, rightRow} from './layout';@@ -90,7 +89,7 @@ export const WebRenderModalPicture: React.FC<WebRenderModalPictureProps> = ({<Checkboxchecked={transparent}onChange={onTransparentChanged}- name={TRANSPARENT}+ name="transparent"/></div></div>diff --git a/packages/studio/src/components/SkillsSettings.tsx b/packages/studio/src/components/SkillsSettings.tsxindex 67dda075d7..2232bc772a 100644--- a/packages/studio/src/components/SkillsSettings.tsx+++ b/packages/studio/src/components/SkillsSettings.tsx@@ -2,6 +2,7 @@ import type {GetRemotionSkillsInfoResponse} from '@remotion/studio-shared';import React, {useCallback, useContext, useMemo} from 'react';import {StudioServerConnectionCtx} from '../helpers/client-id';import {+ BLACK_ALPHA_22,BLUE,BORDER_WHITE_ALPHA_12,LIGHT_TEXT,@@ -40,7 +41,7 @@ const description: React.CSSProperties = {const commandField: React.CSSProperties = {alignItems: 'center',- backgroundColor: 'rgba(0, 0, 0, 0.22)',+ backgroundColor: BLACK_ALPHA_22,borderRadius: 4,display: 'flex',marginTop: 8,diff --git a/packages/studio/src/components/Splitter/SplitterElement.tsx b/packages/studio/src/components/Splitter/SplitterElement.tsxindex 65836effd6..222d92c5be 100644--- a/packages/studio/src/components/Splitter/SplitterElement.tsx+++ b/packages/studio/src/components/Splitter/SplitterElement.tsx@@ -1,6 +1,5 @@import React, {useContext, useMemo} from 'react';import {interpolateColors, random} from 'remotion';-import {RED} from '../../helpers/colors';import {SplitterContext} from './SplitterContext';export const SplitterElement: React.FC<{@@ -58,7 +57,7 @@ export const SplitterElement: React.FC<{backgroundColor: interpolateColors(random(context.flexValue),[0, 1],- [RED, 'blue'],+ ['red', 'blue'],),};}, [context.flexValue, type]);diff --git a/packages/studio/src/components/TimeValue.tsx b/packages/studio/src/components/TimeValue.tsxindex 0042d7fd63..096d4a8112 100644--- a/packages/studio/src/components/TimeValue.tsx+++ b/packages/studio/src/components/TimeValue.tsx@@ -60,7 +60,7 @@ const currentTimeButtonStyle = {padding: 0,border: 'none',lineHeight: '21px',- '--remotion-cli-internals-blue-hovered': WHITE,+ '--remotion-studio-blue-hovered': WHITE,} as React.CSSProperties;const currentTimeSubtitle: React.CSSProperties = {diff --git a/packages/studio/src/components/Timeline/TimelineArrayField.tsx b/packages/studio/src/components/Timeline/TimelineArrayField.tsxindex 809ee1b86b..96fdee1b7d 100644--- a/packages/studio/src/components/Timeline/TimelineArrayField.tsx+++ b/packages/studio/src/components/Timeline/TimelineArrayField.tsx@@ -4,7 +4,6 @@ import type {CanUpdateSequencePropStatusStatic,} from 'remotion';import {- BLACK_FULL_HEX,BORDER_WHITE_ALPHA_12,WHITE,WHITE_ALPHA_08,@@ -93,7 +92,7 @@ const getFallbackItemValue = (field: ArrayFieldSchema): unknown => {}if (field.item.type === 'color') {- return BLACK_FULL_HEX;+ return '#000000';}if (field.item.type === 'enum') {diff --git a/packages/studio/src/components/Timeline/TimelineColorField.tsx b/packages/studio/src/components/Timeline/TimelineColorField.tsxindex 09dac2c586..b532e39d38 100644--- a/packages/studio/src/components/Timeline/TimelineColorField.tsx+++ b/packages/studio/src/components/Timeline/TimelineColorField.tsx@@ -1,6 +1,6 @@import React, {useCallback} from 'react';import type {CanUpdateSequencePropStatusStatic} from 'remotion';-import {BLACK_HEX, BLUE, LIGHT_TEXT} from '../../helpers/colors';+import {BLUE, LIGHT_TEXT} from '../../helpers/colors';import type {SchemaFieldInfo,TimelineFieldOnDragValueChange,@@ -52,7 +52,7 @@ export const TimelineColorField: React.FC<{typeof effectiveValue === 'string'? effectiveValue: field.fieldSchema.type === 'color'- ? (field.fieldSchema.default ?? BLACK_HEX)+ ? (field.fieldSchema.default ?? '#000'): '';const onChange = useCallback(diff --git a/packages/studio/src/components/Timeline/TimelineFontFamilyField.tsx b/packages/studio/src/components/Timeline/TimelineFontFamilyField.tsxindex 0498fc4343..8066db6a8b 100644--- a/packages/studio/src/components/Timeline/TimelineFontFamilyField.tsx+++ b/packages/studio/src/components/Timeline/TimelineFontFamilyField.tsx@@ -5,9 +5,17 @@ import ReactDOM from 'react-dom';import type {CanUpdateSequencePropStatusStatic} from 'remotion';import {BACKGROUND,+ BLACK_ALPHA_60,+ BORDER_WHITE_ALPHA_12,+ FONT_FAMILY_ERROR_COLOR,INPUT_BACKGROUND,LIGHT_TEXT,SELECTED_BACKGROUND,+ TRANSPARENT,+ WHITE,+ WHITE_ALPHA_05,+ WHITE_ALPHA_06,+ WHITE_ALPHA_08,} from '../../helpers/colors';import {installRequiredPackages} from '../../helpers/install-required-package';import type {@@ -36,9 +44,9 @@ const ROW_HEIGHT = 30;const LIST_HEIGHT = 280;const OVERSCAN = 10;const POPOVER_WIDTH = 280;-const CLEAR_HOVER = 'rgba(255, 255, 255, 0.06)';-const INPUT_BORDER_COLOR_UNHOVERED = 'rgba(0, 0, 0, 0.6)';-const INPUT_BORDER_COLOR_HOVERED = 'rgba(255, 255, 255, 0.05)';+const CLEAR_HOVER = WHITE_ALPHA_06;+const INPUT_BORDER_COLOR_UNHOVERED = BLACK_ALPHA_60;+const INPUT_BORDER_COLOR_HOVERED = WHITE_ALPHA_05;const googleFonts = GOOGLE_FONTS_LIST.map((font) => ({id: `google-${font.importName}`,@@ -96,7 +104,7 @@ const triggerStyle: React.CSSProperties = {borderWidth: 1,borderStyle: 'solid',maxWidth: 140,- color: 'white',+ color: WHITE,userSelect: 'none',WebkitUserSelect: 'none',};@@ -114,18 +122,18 @@ const popover: React.CSSProperties = {position: 'fixed',width: POPOVER_WIDTH,backgroundColor: BACKGROUND,- color: 'white',+ color: WHITE,userSelect: 'none',WebkitUserSelect: 'none',- border: '1px solid rgba(255, 255, 255, 0.08)',+ border: `1px solid ${WHITE_ALPHA_08}`,};const searchInput: React.CSSProperties = {boxSizing: 'border-box',width: '100%',backgroundColor: INPUT_BACKGROUND,- border: '1px solid rgba(255, 255, 255, 0.12)',- color: 'white',+ border: BORDER_WHITE_ALPHA_12,+ color: WHITE,fontSize: 12,outline: 'none',padding: '6px 8px',@@ -148,8 +156,8 @@ const optionButton: React.CSSProperties = {height: ROW_HEIGHT,width: '100%',border: 'none',- background: 'transparent',- color: 'white',+ background: TRANSPARENT,+ color: WHITE,display: 'flex',alignItems: 'center',padding: '0 8px',@@ -174,7 +182,7 @@ const optionSource: React.CSSProperties = {const errorText: React.CSSProperties = {padding: '6px 8px',- color: '#ff8a8a',+ color: FONT_FAMILY_ERROR_COLOR,fontSize: 10,};@@ -797,7 +805,7 @@ export const TimelineFontFamilyField: React.FC<{? CLEAR_HOVER: isSelected? SELECTED_BACKGROUND- : 'transparent',+ : TRANSPARENT,}}onPointerEnter={() =>setHighlightedIndex(actualIndex)diff --git a/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx b/packages/studio/src/components/Timeline/TimelineLayerChildren.tsxindex 30e7264d54..45abb6a45d 100644--- a/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx+++ b/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx@@ -6,7 +6,12 @@ import React, {useState,} from 'react';import type {TSequence} from 'remotion';-import {LIGHT_TEXT, TRANSPARENT, WHITE} from '../../helpers/colors';+import {+ CURRENT_COLOR,+ LIGHT_TEXT,+ TRANSPARENT,+ WHITE,+} from '../../helpers/colors';import {FOCUS_VISIBLE_ONLY_CLASS_NAME,HOVERABLE_CLASS_NAME,@@ -187,7 +192,7 @@ export const TimelineLayerChildrenToggle: React.FC<{cursor: 'default',}}>- <TimelineCollapseToggle collapsed={isCollapsed} color="currentColor" />+ <TimelineCollapseToggle collapsed={isCollapsed} color={CURRENT_COLOR} /></button>);};diff --git a/packages/studio/src/components/Timeline/TimelineTimeIndicators.tsx b/packages/studio/src/components/Timeline/TimelineTimeIndicators.tsxindex 0001f2133e..74f3674a85 100644--- a/packages/studio/src/components/Timeline/TimelineTimeIndicators.tsx+++ b/packages/studio/src/components/Timeline/TimelineTimeIndicators.tsx@@ -6,6 +6,7 @@ import {TIMELINE_TRACK_SEPARATOR,WHITE_ALPHA_15,} from '../../helpers/colors';+import {resolveStudioColor} from '../../helpers/resolve-studio-color';import {TIMELINE_ITEM_BORDER_BOTTOM,TIMELINE_PADDING,@@ -277,6 +278,9 @@ const TimelineTimeIndicatorsInner = React.memo<{});const draw = () => {+ const computedStyle = getComputedStyle(canvas);+ const tickColor = resolveStudioColor(WHITE_ALPHA_15, computedStyle);+ const labelColor = resolveStudioColor(LIGHT_TEXT, computedStyle);const {clientWidth: width, scrollLeft} = scrollable;const pixelRatio = window.devicePixelRatio;const canvasWidth = Math.ceil(width * pixelRatio);@@ -292,7 +296,7 @@ const TimelineTimeIndicatorsInner = React.memo<{context.resetTransform();context.clearRect(0, 0, canvas.width, canvas.height);context.scale(pixelRatio, pixelRatio);- context.fillStyle = WHITE_ALPHA_15;+ context.fillStyle = tickColor;const firstFrame = Math.max(0,@@ -321,15 +325,15 @@ const TimelineTimeIndicatorsInner = React.memo<{const frame = second * fps;drawTick(frame, 15);if (second > 0) {- context.fillStyle = LIGHT_TEXT;- context.font = `${TICK_LABEL_FONT_SIZE}px ${getComputedStyle(canvas).fontFamily}`;+ context.fillStyle = labelColor;+ context.font = `${TICK_LABEL_FONT_SIZE}px ${computedStyle.fontFamily}`;context.textBaseline = 'top';context.fillText(showFrames ? `${Math.round(frame)}f` : renderFrame(frame, fps),xForFrame(frame) + TICK_LABEL_MARGIN_LEFT,7,);- context.fillStyle = WHITE_ALPHA_15;+ context.fillStyle = tickColor;}}diff --git a/packages/studio/src/components/UpdatesSettings.tsx b/packages/studio/src/components/UpdatesSettings.tsxindex 7789d11018..c670383ccb 100644--- a/packages/studio/src/components/UpdatesSettings.tsx+++ b/packages/studio/src/components/UpdatesSettings.tsx@@ -12,6 +12,7 @@ import {WHITE,} from '../helpers/colors';import {copyText} from '../helpers/copy-text';+import {studioCssVariables} from '../helpers/studio-css-variables';import {useCopyFeedback} from '../helpers/use-copy-feedback';import {CopyIcon} from '../icons/copy';import type {RenderInlineAction} from './InlineAction';@@ -158,6 +159,7 @@ const RenderedReleaseNotes: React.FC<{}return `<!doctype html><html><head><base href="https://github.com/remotion-dev/remotion/" target="_blank"><style>+ ${studioCssVariables}:root { color-scheme: dark; }html, body { overflow: hidden; }body { background: ${BACKGROUND}; color: ${LIGHT_TEXT}; font-family: sans-serif; font-size: 13px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }diff --git a/packages/studio/src/components/selected-outline-measurement.ts b/packages/studio/src/components/selected-outline-measurement.tsindex 04a06b83af..24efb02093 100644--- a/packages/studio/src/components/selected-outline-measurement.ts+++ b/packages/studio/src/components/selected-outline-measurement.ts@@ -3,6 +3,7 @@ import {calculateTimeline} from '../helpers/calculate-timeline';import {BLACK, WHITE} from '../helpers/colors';import {useCache as resetBoxQuadsCache} from '../helpers/get-box-quads-polyfill-internals.js';import {getBoxQuadsPonyfill} from '../helpers/get-box-quads-ponyfill';+import {studioCssVariables} from '../helpers/studio-css-variables';import {timelineSequenceNodePathToKey} from '../helpers/timeline-node-path-key';import type {OutlinePoint, SelectedOutline} from './selected-outline-geometry';import {mixPoint} from './selected-outline-geometry';@@ -96,7 +97,7 @@ export const getRotationCursor = (rotation: number): string => {? '': `<g transform="rotate(${normalizedRotation} 32 32)">`;const transformEnd = normalizedRotation === 0 ? '' : '</g>';- const svg = `<svg width="24" height="24" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">${transform}<g transform="scale(0.876712329)" filter="url(#filter0_d_1_14)"><path d="M10.9111 17.7687C10.3413 18.3701 10.367 19.3195 10.9684 19.8893L20.7687 29.1738C21.3701 29.7436 22.3195 29.7179 22.8893 29.1165C23.459 28.5151 23.4334 27.5657 22.832 26.996L14.1206 18.7431L22.3735 10.0316C22.9432 9.43022 22.9176 8.48082 22.3162 7.91107C21.7148 7.34133 20.7654 7.36699 20.1956 7.96839L10.9111 17.7687ZM49.3923 58.3118C49.9509 58.9235 50.8996 58.9667 51.5114 58.4081L61.481 49.3055C62.0927 48.7469 62.1359 47.7981 61.5773 47.1863C61.0187 46.5745 60.0699 46.5314 59.4581 47.09L50.5963 55.1812L42.5051 46.3194C41.9465 45.7076 40.9977 45.6645 40.386 46.2231C39.7742 46.7817 39.7311 47.7304 40.2896 48.3422L49.3923 58.3118ZM12.6747 18.7431L13 19.8893C22.1283 19.6426 30.7584 21.4283 37.8564 26.6927C44.8518 31.8809 49.734 39.8538 49 56H50.5963H51.5114C52.2774 39.1461 47.6482 30.2198 39.6436 24.2831C31.7416 18.4224 22.3717 17.2467 13 17.5L12.6747 18.7431Z" fill="${BLACK}"/><path d="M19.1064 6.93652C20.2459 5.73379 22.1448 5.68278 23.3477 6.82227C24.5505 7.96181 24.6022 9.86076 23.4629 11.0635L18.7373 16.0508C26.3487 16.4239 33.9128 18.1651 40.5371 23.0781C44.7339 26.1907 48.0794 30.1189 50.2568 35.4834C51.9666 39.6958 52.9327 44.7395 53.0742 50.8867L58.4463 45.9824C59.6697 44.8654 61.5673 44.9514 62.6846 46.1748C63.8018 47.3985 63.7155 49.296 62.4922 50.4131L52.5225 59.5156C51.337 60.5979 49.5196 60.5507 48.3916 59.4346L48.2842 59.3232L39.1816 49.3535C38.0648 48.1301 38.1507 46.2324 39.374 45.1152C40.5975 43.9979 42.4961 44.0841 43.6133 45.3076L47.4756 49.5381C47.1908 44.7613 46.2876 40.9448 44.9482 37.8291C43.0666 33.4521 40.2851 30.3614 36.9629 27.8975C31.8259 24.0875 25.8071 22.1663 19.2891 21.5732L23.8633 25.9072C25.0662 27.0468 25.1178 28.9457 23.9785 30.1484C22.8746 31.3135 21.0576 31.3982 19.8516 30.3662L19.7373 30.2627L9.93652 20.9785C8.73384 19.839 8.6828 17.9401 9.82227 16.7373L19.1064 6.93652Z" stroke="${WHITE}" stroke-width="3"/></g>${transformEnd}<defs><filter id="filter0_d_1_14" x="0" y="0" width="72.4696" height="72.3004" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="3.75"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_14"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_14" result="shape"/></filter></defs></svg>`;+ const svg = `<svg width="24" height="24" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg"><style>${studioCssVariables}</style>${transform}<g transform="scale(0.876712329)" filter="url(#filter0_d_1_14)"><path d="M10.9111 17.7687C10.3413 18.3701 10.367 19.3195 10.9684 19.8893L20.7687 29.1738C21.3701 29.7436 22.3195 29.7179 22.8893 29.1165C23.459 28.5151 23.4334 27.5657 22.832 26.996L14.1206 18.7431L22.3735 10.0316C22.9432 9.43022 22.9176 8.48082 22.3162 7.91107C21.7148 7.34133 20.7654 7.36699 20.1956 7.96839L10.9111 17.7687ZM49.3923 58.3118C49.9509 58.9235 50.8996 58.9667 51.5114 58.4081L61.481 49.3055C62.0927 48.7469 62.1359 47.7981 61.5773 47.1863C61.0187 46.5745 60.0699 46.5314 59.4581 47.09L50.5963 55.1812L42.5051 46.3194C41.9465 45.7076 40.9977 45.6645 40.386 46.2231C39.7742 46.7817 39.7311 47.7304 40.2896 48.3422L49.3923 58.3118ZM12.6747 18.7431L13 19.8893C22.1283 19.6426 30.7584 21.4283 37.8564 26.6927C44.8518 31.8809 49.734 39.8538 49 56H50.5963H51.5114C52.2774 39.1461 47.6482 30.2198 39.6436 24.2831C31.7416 18.4224 22.3717 17.2467 13 17.5L12.6747 18.7431Z" fill="${BLACK}"/><path d="M19.1064 6.93652C20.2459 5.73379 22.1448 5.68278 23.3477 6.82227C24.5505 7.96181 24.6022 9.86076 23.4629 11.0635L18.7373 16.0508C26.3487 16.4239 33.9128 18.1651 40.5371 23.0781C44.7339 26.1907 48.0794 30.1189 50.2568 35.4834C51.9666 39.6958 52.9327 44.7395 53.0742 50.8867L58.4463 45.9824C59.6697 44.8654 61.5673 44.9514 62.6846 46.1748C63.8018 47.3985 63.7155 49.296 62.4922 50.4131L52.5225 59.5156C51.337 60.5979 49.5196 60.5507 48.3916 59.4346L48.2842 59.3232L39.1816 49.3535C38.0648 48.1301 38.1507 46.2324 39.374 45.1152C40.5975 43.9979 42.4961 44.0841 43.6133 45.3076L47.4756 49.5381C47.1908 44.7613 46.2876 40.9448 44.9482 37.8291C43.0666 33.4521 40.2851 30.3614 36.9629 27.8975C31.8259 24.0875 25.8071 22.1663 19.2891 21.5732L23.8633 25.9072C25.0662 27.0468 25.1178 28.9457 23.9785 30.1484C22.8746 31.3135 21.0576 31.3982 19.8516 30.3662L19.7373 30.2627L9.93652 20.9785C8.73384 19.839 8.6828 17.9401 9.82227 16.7373L19.1064 6.93652Z" stroke="${WHITE}" stroke-width="3"/></g>${transformEnd}<defs><filter id="filter0_d_1_14" x="0" y="0" width="72.4696" height="72.3004" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="3"/><feGaussianBlur stdDeviation="3.75"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_14"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_14" result="shape"/></filter></defs></svg>`;return `url("data:image/svg+xml,${encodeURIComponent(svg)}") 12 12, alias`;};diff --git a/packages/studio/src/components/selected-outline-snap.ts b/packages/studio/src/components/selected-outline-snap.tsindex adf5e67298..4102f606a2 100644--- a/packages/studio/src/components/selected-outline-snap.ts+++ b/packages/studio/src/components/selected-outline-snap.ts@@ -1,8 +1,9 @@+import {SELECTED_OUTLINE_SNAP_COLOR} from '../helpers/colors';import type {Guide} from '../state/editor-guides';import type {SelectedOutline} from './selected-outline-geometry';export const selectedOutlineSnapThresholdPx = 10;-export const selectedOutlineSnapIndicatorColor = '#ff00ff';+export const selectedOutlineSnapIndicatorColor = SELECTED_OUTLINE_SNAP_COLOR;export type SelectedOutlineSnapAxis = 'x' | 'y';diff --git a/packages/studio/src/helpers/colors.ts b/packages/studio/src/helpers/colors.tsindex 17fb2fbc18..277a171567 100644--- a/packages/studio/src/helpers/colors.ts+++ b/packages/studio/src/helpers/colors.ts@@ -1,86 +1,144 @@-export const BLACK = 'black';-export const WHITE = 'white';-export const RED = 'red';-export const TRANSPARENT = 'transparent';-export const CURRENT_COLOR = 'currentColor';-export const CURRENT_COLOR_LOWERCASE = 'currentcolor';-export const WHITE_HEX = '#fff';-export const WHITE_FULL_HEX = '#ffffff';-export const BLACK_HEX = '#000';-export const BLACK_FULL_HEX = '#000000';+// The palette lives in studio-css-variables.ts. Equivalent legacy names share+// one variable so changing a color updates every Studio consumer.+export const BLACK = 'var(--remotion-studio-black)';+export const WHITE = 'var(--remotion-studio-white)';+export const RED = 'var(--remotion-studio-red)';+export const TRANSPARENT = 'var(--remotion-studio-transparent)';+export const CURRENT_COLOR = 'var(--remotion-studio-current-color)';+export const CURRENT_COLOR_LOWERCASE = 'var(--remotion-studio-current-color)';+export const WHITE_HEX = 'var(--remotion-studio-white)';+export const WHITE_FULL_HEX = 'var(--remotion-studio-white)';+export const BLACK_HEX = 'var(--remotion-studio-black)';+export const BLACK_FULL_HEX = 'var(--remotion-studio-black)';-export const BACKGROUND = 'rgb(31,36,40)';-export const BACKGROUND_HEX = '#1f2428';-export const BACKGROUND__TRANSPARENT = 'rgba(31,36,40, 0)';-export const INPUT_BACKGROUND = '#2f363d';-export const LIGHT_COLOR = '#ddd';-export const SELECTED_BACKGROUND = 'hsla(0, 0%, 100%, 0.15)';-export const LIGHT_TEXT = '#A6A7A9';-export const RULER_COLOR = '#808080';-export const WHITE_ALPHA_05 = 'rgba(255, 255, 255, 0.05)';-export const WHITE_ALPHA_06 = 'rgba(255, 255, 255, 0.06)';-export const WHITE_ALPHA_08 = 'rgba(255, 255, 255, 0.08)';-export const WHITE_ALPHA_10 = 'rgba(255, 255, 255, 0.1)';-export const WHITE_ALPHA_12 = 'rgba(255, 255, 255, 0.12)';-export const WHITE_ALPHA_15 = 'rgba(255, 255, 255, 0.15)';-export const WHITE_ALPHA_20 = 'rgba(255, 255, 255, 0.2)';-export const WHITE_ALPHA_25 = 'rgba(255, 255, 255, 0.25)';-export const WHITE_ALPHA_30 = 'rgba(255, 255, 255, 0.3)';-export const WHITE_ALPHA_35 = 'rgba(255, 255, 255, 0.35)';-export const WHITE_ALPHA_40 = 'rgba(255, 255, 255, 0.4)';-export const WHITE_ALPHA_45 = 'rgba(255, 255, 255, 0.45)';-export const WHITE_ALPHA_50 = 'rgba(255, 255, 255, 0.5)';-export const WHITE_ALPHA_60 = 'rgba(255, 255, 255, 0.6)';-export const WHITE_ALPHA_70 = 'rgba(255, 255, 255, 0.7)';-export const WHITE_ALPHA_72 = 'rgba(255, 255, 255, 0.72)';-export const WHITE_ALPHA_80 = 'rgba(255, 255, 255, 0.8)';-export const WHITE_ALPHA_90 = 'rgba(255, 255, 255, 0.9)';-export const BLACK_ALPHA_10 = 'rgba(0, 0, 0, 0.1)';-export const BLACK_ALPHA_28 = 'rgba(0, 0, 0, 0.28)';-export const BLACK_ALPHA_30 = 'rgba(0, 0, 0, 0.3)';-export const BLACK_ALPHA_40 = 'rgba(0, 0, 0, 0.4)';-export const BLACK_ALPHA_50 = 'rgba(0, 0, 0, 0.5)';-export const BLACK_ALPHA_60 = 'rgba(0, 0, 0, 0.6)';-export const BLACK_ALPHA_80 = 'rgba(0, 0, 0, 0.8)';-export const BLACK_ALPHA_85 = 'rgba(0, 0, 0, 0.85)';-export const BLACK_ALPHA_90 = 'rgba(0, 0, 0, 0.9)';-export const BLACK_OPAQUE = 'rgba(0, 0, 0, 1)';-const SELECTED_HOVER_BACKGROUND = 'hsla(0, 0%, 100%, 0.25)';-export const FAIL_COLOR = '#ff3232';-export const WARNING_COLOR = '#f1c40f';-export const BLUE = '#0b84f3';-export const BLUE_HOVERED = '#4da3f7';-export const BLUE_DISABLED = '#284f73';-export const UNSELECTED_GUIDE = '#7e1219';-export const SELECTED_GUIDE = '#d22d3a';-export const LINE_COLOR = '#363A3E';-export const TIMELINE_TRACK_SEPARATOR = '#13161B';+export const BACKGROUND = 'var(--remotion-studio-background)';+export const BACKGROUND_HEX = 'var(--remotion-studio-background)';+export const BACKGROUND__TRANSPARENT =+ 'var(--remotion-studio-background-transparent)';+export const INPUT_BACKGROUND = 'var(--remotion-studio-input-background)';+export const LIGHT_COLOR = 'var(--remotion-studio-light-color)';+export const SELECTED_BACKGROUND = 'var(--remotion-studio-white-alpha-15)';+export const LIGHT_TEXT = 'var(--remotion-studio-light-text)';+export const RULER_COLOR = 'var(--remotion-studio-ruler-color)';+export const WHITE_ALPHA_05 = 'var(--remotion-studio-white-alpha-05)';+export const WHITE_ALPHA_06 = 'var(--remotion-studio-white-alpha-06)';+export const WHITE_ALPHA_08 = 'var(--remotion-studio-white-alpha-08)';+export const WHITE_ALPHA_10 = 'var(--remotion-studio-white-alpha-10)';+export const WHITE_ALPHA_12 = 'var(--remotion-studio-white-alpha-12)';+export const WHITE_ALPHA_15 = 'var(--remotion-studio-white-alpha-15)';+export const WHITE_ALPHA_20 = 'var(--remotion-studio-white-alpha-20)';+export const WHITE_ALPHA_25 = 'var(--remotion-studio-white-alpha-25)';+export const WHITE_ALPHA_30 = 'var(--remotion-studio-white-alpha-30)';+export const WHITE_ALPHA_35 = 'var(--remotion-studio-white-alpha-35)';+export const WHITE_ALPHA_40 = 'var(--remotion-studio-white-alpha-40)';+export const WHITE_ALPHA_45 = 'var(--remotion-studio-white-alpha-45)';+export const WHITE_ALPHA_50 = 'var(--remotion-studio-white-alpha-50)';+export const WHITE_ALPHA_60 = 'var(--remotion-studio-white-alpha-60)';+export const WHITE_ALPHA_70 = 'var(--remotion-studio-white-alpha-70)';+export const WHITE_ALPHA_72 = 'var(--remotion-studio-white-alpha-72)';+export const WHITE_ALPHA_80 = 'var(--remotion-studio-white-alpha-80)';+export const WHITE_ALPHA_90 = 'var(--remotion-studio-white-alpha-90)';+export const BLACK_ALPHA_10 = 'var(--remotion-studio-black-alpha-10)';+export const BLACK_ALPHA_28 = 'var(--remotion-studio-black-alpha-28)';+export const BLACK_ALPHA_30 = 'var(--remotion-studio-black-alpha-30)';+export const BLACK_ALPHA_40 = 'var(--remotion-studio-black-alpha-40)';+export const BLACK_ALPHA_50 = 'var(--remotion-studio-black-alpha-50)';+export const BLACK_ALPHA_60 = 'var(--remotion-studio-black-alpha-60)';+export const BLACK_ALPHA_80 = 'var(--remotion-studio-black-alpha-80)';+export const BLACK_ALPHA_85 = 'var(--remotion-studio-black-alpha-85)';+export const BLACK_ALPHA_90 = 'var(--remotion-studio-black-alpha-90)';+export const BLACK_OPAQUE = 'var(--remotion-studio-black)';+const SELECTED_HOVER_BACKGROUND = 'var(--remotion-studio-white-alpha-25)';+export const FAIL_COLOR = 'var(--remotion-studio-fail-color)';+export const WARNING_COLOR = 'var(--remotion-studio-warning-color)';+export const BLUE = 'var(--remotion-studio-blue)';+export const BLUE_HOVERED = 'var(--remotion-studio-blue-hovered)';+export const BLUE_DISABLED = 'var(--remotion-studio-blue-disabled)';+export const UNSELECTED_GUIDE = 'var(--remotion-studio-unselected-guide)';+export const SELECTED_GUIDE = 'var(--remotion-studio-selected-guide)';+export const LINE_COLOR = 'var(--remotion-studio-line-color)';+export const TIMELINE_TRACK_SEPARATOR =+ 'var(--remotion-studio-timeline-track-separator)';-export const LIGHT_GRAY = '#ccc';-export const KEYBOARD_SHORTCUT_KEY_COLOR = '#eee';-export const NOTIFICATION_BACKGROUND = '#111111';-export const RENDER_STATUS_BACKGROUND = '#222';-export const ERROR_CODE_FRAME_BACKGROUND = '#070707';-export const ERROR_CODE_FRAME_LINE_BACKGROUND = '#121212';-export const ERROR_LINK_COLOR = '#58a6ff';-export const INFO_BLUE = '#60a5fa';-export const SERVER_DISCONNECTED_BACKGROUND = '#e74c3c';-export const TIMELINE_BACKGROUND_COLOR = '#15181B';+export const LIGHT_GRAY = 'var(--remotion-studio-light-gray)';+export const KEYBOARD_SHORTCUT_KEY_COLOR =+ 'var(--remotion-studio-keyboard-shortcut-key-color)';+export const NOTIFICATION_BACKGROUND =+ 'var(--remotion-studio-notification-background)';+export const RENDER_STATUS_BACKGROUND =+ 'var(--remotion-studio-render-status-background)';+export const ERROR_CODE_FRAME_BACKGROUND =+ 'var(--remotion-studio-error-code-frame-background)';+export const ERROR_CODE_FRAME_LINE_BACKGROUND =+ 'var(--remotion-studio-error-code-frame-line-background)';+export const ERROR_LINK_COLOR = 'var(--remotion-studio-error-link-color)';+export const INFO_BLUE = 'var(--remotion-studio-info-blue)';+export const SERVER_DISCONNECTED_BACKGROUND =+ 'var(--remotion-studio-server-disconnected-background)';+export const TIMELINE_BACKGROUND_COLOR =+ 'var(--remotion-studio-timeline-background-color)';// WHITE_ALPHA_10 composited over TIMELINE_BACKGROUND_COLOR.-export const TIMELINE_NEGATIVE_START_BACKGROUND_COLOR = '#2C2F32';+export const TIMELINE_NEGATIVE_START_BACKGROUND_COLOR =+ 'var(--remotion-studio-timeline-negative-start-background-color)';// WHITE_ALPHA_10 composited over TIMELINE_NEGATIVE_START_BACKGROUND_COLOR.-export const TIMELINE_NEGATIVE_START_BORDER_COLOR = '#414446';-export const TIMELINE_SELECTED_BACKGROUND_COLOR = '#3B3F42';-export const TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR = '#B0B0B0';-export const TIMELINE_BLUE = '#0b84ff';-export const TIMELINE_PLAYHEAD_COLOR = '#f02c00';-export const TIMELINE_DROP_BLUE_ALPHA_12 = 'rgba(0, 155, 255, 0.12)';-export const TIMELINE_DROP_BLUE_ALPHA_16 = 'rgba(0, 155, 255, 0.16)';-export const TIMELINE_DROP_BLUE_ALPHA_75 = 'rgba(0, 155, 255, 0.75)';-export const TIMELINE_MARQUEE_BLUE_ALPHA_16 = 'rgba(70, 130, 255, 0.16)';-export const TIMELINE_MARQUEE_BLUE_ALPHA_75 = 'rgba(70, 130, 255, 0.75)';-export const EASING_SELECTED_BACKGROUND = 'rgba(11, 132, 243, 0.18)';-export const INFO_BLUE_BACKGROUND = 'rgba(59, 130, 246, 0.15)';+export const TIMELINE_NEGATIVE_START_BORDER_COLOR =+ 'var(--remotion-studio-timeline-negative-start-border-color)';+export const TIMELINE_SELECTED_BACKGROUND_COLOR =+ 'var(--remotion-studio-timeline-selected-background-color)';+export const TIMELINE_SELECTED_LABEL_BACKGROUND_COLOR =+ 'var(--remotion-studio-timeline-selected-label-background-color)';+export const TIMELINE_BLUE = 'var(--remotion-studio-timeline-blue)';+export const TIMELINE_PLAYHEAD_COLOR =+ 'var(--remotion-studio-timeline-playhead-color)';+export const TIMELINE_DROP_BLUE_ALPHA_12 =+ 'var(--remotion-studio-timeline-drop-blue-alpha-12)';+export const TIMELINE_DROP_BLUE_ALPHA_16 =+ 'var(--remotion-studio-timeline-drop-blue-alpha-16)';+export const TIMELINE_DROP_BLUE_ALPHA_75 =+ 'var(--remotion-studio-timeline-drop-blue-alpha-75)';+export const TIMELINE_MARQUEE_BLUE_ALPHA_16 =+ 'var(--remotion-studio-timeline-marquee-blue-alpha-16)';+export const TIMELINE_MARQUEE_BLUE_ALPHA_75 =+ 'var(--remotion-studio-timeline-marquee-blue-alpha-75)';+export const EASING_SELECTED_BACKGROUND =+ 'var(--remotion-studio-easing-selected-background)';+export const INFO_BLUE_BACKGROUND =+ 'var(--remotion-studio-info-blue-background)';++export const FOCUS_COLOR = 'var(--remotion-studio-focus-color)';+export const COLOR_PICKER_CHECKER_COLOR =+ 'var(--remotion-studio-color-picker-checker-color)';+export const INFO_BLUE_BORDER_COLOR =+ 'var(--remotion-studio-info-blue-border-color)';+export const BLACK_ALPHA_22 = 'var(--remotion-studio-black-alpha-22)';+export const FONT_FAMILY_ERROR_COLOR =+ 'var(--remotion-studio-font-family-error-color)';+export const SELECTED_OUTLINE_SNAP_COLOR =+ 'var(--remotion-studio-selected-outline-snap-color)';+export const PRISM_TEXT_COLOR = 'var(--remotion-studio-prism-text-color)';+export const PRISM_SELECTION_BACKGROUND =+ 'var(--remotion-studio-prism-selection-background)';+export const PRISM_BACKGROUND = 'var(--remotion-studio-prism-background)';+export const PRISM_INLINE_COLOR = 'var(--remotion-studio-prism-inline-color)';+export const PRISM_KEYWORD_COLOR = 'var(--remotion-studio-prism-keyword-color)';+export const PRISM_VARIABLE_COLOR =+ 'var(--remotion-studio-prism-variable-color)';+export const PRISM_COMMENT_COLOR = 'var(--remotion-studio-prism-comment-color)';+export const PRISM_NUMBER_COLOR = 'var(--remotion-studio-prism-number-color)';+export const PRISM_STRING_COLOR = 'var(--remotion-studio-prism-string-color)';+export const PRISM_CONTROL_FLOW_COLOR =+ 'var(--remotion-studio-prism-control-flow-color)';+export const PRISM_FUNCTION_COLOR =+ 'var(--remotion-studio-prism-function-color)';+export const PRISM_REGEX_COLOR = 'var(--remotion-studio-prism-regex-color)';+export const PRISM_CLASS_NAME_COLOR =+ 'var(--remotion-studio-prism-class-name-color)';+export const PRISM_SELECTOR_COLOR =+ 'var(--remotion-studio-prism-selector-color)';+export const PRISM_LINE_HIGHLIGHT_BACKGROUND =+ 'var(--remotion-studio-prism-line-highlight-background)';+export const PRISM_LINE_HIGHLIGHT_BORDER_COLOR =+ 'var(--remotion-studio-prism-line-highlight-border-color)';export const BORDER_BLACK = `1px solid ${BLACK_HEX}`;export const BORDER_WHITE = `1px solid ${WHITE_HEX}`;@@ -91,7 +149,7 @@ export const BORDER_BLACK_ALPHA_50 = `1px solid ${BLACK_ALPHA_50}`;export const BORDER_BLACK_ALPHA_60 = `1px solid ${BLACK_ALPHA_60}`;export const BORDER_WHITE_ALPHA_12 = `1px solid ${WHITE_ALPHA_12}`;export const BORDER_WHITE_ALPHA_20 = `1px solid ${WHITE_ALPHA_20}`;-export const BORDER_INFO_BLUE = '1px solid rgba(59, 130, 246, 0.4)';+export const BORDER_INFO_BLUE = `1px solid ${INFO_BLUE_BORDER_COLOR}`;export const BORDER_TIMELINE_DROP_BLUE = `1px solid ${TIMELINE_DROP_BLUE_ALPHA_75}`;export const BORDER_TIMELINE_MARQUEE_BLUE = `1px solid ${TIMELINE_MARQUEE_BLUE_ALPHA_75}`;export const SHADOW_BLACK = `0 0 4px ${BLACK}`;@@ -103,11 +161,9 @@ export const COLOR_PICKER_POPUP_SHADOW = `0 4px 16px ${BLACK_ALPHA_50}`;export const COLOR_PICKER_HANDLE_SHADOW = `0 0 0 1px ${BLACK_ALPHA_60}`;export const NOTIFICATION_BORDER = `0.25px solid ${WHITE_ALPHA_10}`;-export const HOT_MIDDLEWARE_ERROR_STYLE = 'color: #ff0000;';-export const HOT_MIDDLEWARE_WARNING_STYLE = 'color: #999933;';export const FOCUS_BOX_SHADOW =- `inset 1px 1px #555, inset -1px -1px #555, ` +- `inset 1px -1px #555, inset -1px 1px #555`;+ `inset 1px 1px ${FOCUS_COLOR}, inset -1px -1px ${FOCUS_COLOR}, ` ++ `inset 1px -1px ${FOCUS_COLOR}, inset -1px 1px ${FOCUS_COLOR}`;export const CHECKERBOARD_BACKGROUND_IMAGE = `linear-gradient(@@ -121,16 +177,18 @@ export const CHECKERBOARD_BACKGROUND_IMAGE = ``;export const COLOR_PICKER_CHECKER_BACKGROUND_IMAGE =- `linear-gradient(45deg, #888 25%, ${TRANSPARENT} 25%), ` +- `linear-gradient(-45deg, #888 25%, ${TRANSPARENT} 25%), ` +- `linear-gradient(45deg, ${TRANSPARENT} 75%, #888 75%), ` +- `linear-gradient(-45deg, ${TRANSPARENT} 75%, #888 75%)`;-export const COLOR_PICKER_CHECKER_BACKGROUND_COLOR = '#444';+ `linear-gradient(45deg, ${COLOR_PICKER_CHECKER_COLOR} 25%, ${TRANSPARENT} 25%), ` ++ `linear-gradient(-45deg, ${COLOR_PICKER_CHECKER_COLOR} 25%, ${TRANSPARENT} 25%), ` ++ `linear-gradient(45deg, ${TRANSPARENT} 75%, ${COLOR_PICKER_CHECKER_COLOR} 75%), ` ++ `linear-gradient(-45deg, ${TRANSPARENT} 75%, ${COLOR_PICKER_CHECKER_COLOR} 75%)`;+export const COLOR_PICKER_CHECKER_BACKGROUND_COLOR =+ 'var(--remotion-studio-color-picker-checker-background-color)';export const COLOR_PICKER_SATURATION_VALUE_GRADIENT = `linear-gradient(to right, ${WHITE_HEX}, ${TRANSPARENT})`;export const COLOR_PICKER_SATURATION_BLACK_GRADIENT = `linear-gradient(to top, ${BLACK_HEX}, ${TRANSPARENT})`;-export const COLOR_PICKER_ALPHA_TRANSPARENT = 'rgba(0, 0, 0, 0)';+export const COLOR_PICKER_ALPHA_TRANSPARENT =+ 'var(--remotion-studio-transparent)';export const COLOR_PICKER_HUE_GRADIENT =- 'linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)';+ 'var(--remotion-studio-color-picker-hue-gradient)';export const ERROR_MESSAGE_MASK_IMAGE = `linear-gradient(to bottom, ${WHITE} 60%, ${TRANSPARENT})`;export const SELECTED_OUTLINE_DROP_SHADOW = `drop-shadow(0 0 1px ${WHITE_ALPHA_20})`;@@ -140,9 +198,9 @@ export const LOOPED_INDICATOR_DROP_SHADOW =`drop-shadow(0 1px 2px ${BLACK_ALPHA_80})`;export const TIMELINE_AUDIO_GRADIENT =- 'linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%)';+ 'var(--remotion-studio-timeline-audio-gradient)';export const TIMELINE_VIDEO_GRADIENT =- 'linear-gradient(to top, #8e44ad, #9b59b6)';+ 'var(--remotion-studio-timeline-video-gradient)';export const getBackgroundFromHoverState = ({selected,diff --git a/packages/studio/src/helpers/editor-ruler.ts b/packages/studio/src/helpers/editor-ruler.tsindex 6f7a4cbc33..331df2325f 100644--- a/packages/studio/src/helpers/editor-ruler.ts+++ b/packages/studio/src/helpers/editor-ruler.ts@@ -7,6 +7,7 @@ import {WHITE_ALPHA_15,} from './colors';import type {RulerGuideHighlight} from './editor-guide-selection';+import {resolveStudioColor} from './resolve-studio-color';type Orientation = 'horizontal' | 'vertical';@@ -36,12 +37,14 @@ const drawLabel = ({const drawGradient = ({orientation,context,+ computedStyle,originDistance,canvasHeight,canvasWidth,}: {orientation: Orientation;context: CanvasRenderingContext2D;+ computedStyle: CSSStyleDeclaration;originDistance: number;canvasHeight: number;canvasWidth: number;@@ -54,10 +57,15 @@ const drawGradient = ({const endY =orientation === 'horizontal' ? canvasHeight : originDistance + size / 2;const grd = context.createLinearGradient(startX, startY, endX, endY);- grd.addColorStop(0, BACKGROUND__TRANSPARENT);- grd.addColorStop(0.25, BACKGROUND);- grd.addColorStop(0.75, BACKGROUND);- grd.addColorStop(1, BACKGROUND__TRANSPARENT);+ const background = resolveStudioColor(BACKGROUND, computedStyle);+ const transparentBackground = resolveStudioColor(+ BACKGROUND__TRANSPARENT,+ computedStyle,+ );+ grd.addColorStop(0, transparentBackground);+ grd.addColorStop(0.25, background);+ grd.addColorStop(0.75, background);+ grd.addColorStop(1, transparentBackground);context.fillStyle = grd;context.fillRect(startX, startY, endX - startX, endY - startY);@@ -68,6 +76,7 @@ const drawGuide = ({scale,startMarking,context,+ computedStyle,canvasHeight,canvasWidth,orientation,@@ -77,12 +86,14 @@ const drawGuide = ({scale: number;startMarking: number;context: CanvasRenderingContext2D;+ computedStyle: CSSStyleDeclaration;canvasHeight: number;canvasWidth: number;orientation: Orientation;originOffset: number;}) => {- const {guide, color} = guideHighlight;+ const {guide} = guideHighlight;+ const color = resolveStudioColor(guideHighlight.color, computedStyle);const originDistance =rulerValueToPosition({value: guide.position,@@ -95,6 +106,7 @@ const drawGuide = ({drawGradient({canvasHeight,context,+ computedStyle,orientation,originDistance,canvasWidth,@@ -163,6 +175,9 @@ export const drawMarkingOnRulerCanvas = ({const context = canvas.getContext('2d');if (!context) return;+ const computedStyle = getComputedStyle(canvas);+ const tickColor = resolveStudioColor(WHITE_ALPHA_15, computedStyle);+ const labelColor = resolveStudioColor(LIGHT_TEXT, computedStyle);canvas.width = canvasWidth;canvas.height = canvasHeight;@@ -171,11 +186,11 @@ export const drawMarkingOnRulerCanvas = ({context.clearRect(0, 0, canvasWidth, canvasHeight);- context.strokeStyle = WHITE_ALPHA_15;+ context.strokeStyle = tickColor;context.lineWidth = 1;context.beginPath();points.forEach((point) => {- context.strokeStyle = WHITE_ALPHA_15;+ context.strokeStyle = tickColor;context.lineWidth = 1;const originDistance = point.position + originOffset - startMarking * scale;context.beginPath();@@ -202,19 +217,20 @@ export const drawMarkingOnRulerCanvas = ({context.stroke();context.font = '10px Arial, Helvetica, sans-serif';context.textAlign = 'left';- context.fillStyle = LIGHT_TEXT;+ context.fillStyle = labelColor;drawLabel({orientation,context,label: point.value.toString(),originDistance,- color: LIGHT_TEXT,+ color: labelColor,});});if (guideHighlight && orientation !== guideHighlight.guide.orientation) {drawGuide({+ computedStyle,canvasHeight,canvasWidth,context,diff --git a/packages/studio/src/helpers/hoverable.ts b/packages/studio/src/helpers/hoverable.tsindex 6a57f8ae95..1e21b545a3 100644--- a/packages/studio/src/helpers/hoverable.ts+++ b/packages/studio/src/helpers/hoverable.ts@@ -13,10 +13,10 @@ export const HOVER_GROUP_CLASS_NAME = '__remotion-hover-group';export const HOVER_GROUP_REVEAL_CLASS_NAME = '__remotion-hover-group-reveal';export const FOCUS_VISIBLE_ONLY_CLASS_NAME = '__remotion-focus-visible-only';-const BG_VARIABLE = '--remotion-hoverable-bg';-const HOVER_BG_VARIABLE = '--remotion-hoverable-hover-bg';-const COLOR_VARIABLE = '--remotion-hoverable-color';-const HOVER_COLOR_VARIABLE = '--remotion-hoverable-hover-color';+const BG_VARIABLE = '--remotion-studio-hoverable-bg';+const HOVER_BG_VARIABLE = '--remotion-studio-hoverable-hover-bg';+const COLOR_VARIABLE = '--remotion-studio-hoverable-color';+const HOVER_COLOR_VARIABLE = '--remotion-studio-hoverable-hover-color';export const NO_HOVER_BACKGROUND_STYLE = {[HOVER_BG_VARIABLE]: TRANSPARENT,diff --git a/packages/studio/src/helpers/inject-css.ts b/packages/studio/src/helpers/inject-css.tsindex 10eea6575e..fdc328541b 100644--- a/packages/studio/src/helpers/inject-css.ts+++ b/packages/studio/src/helpers/inject-css.ts@@ -17,8 +17,6 @@ const makeDefaultGlobalCSS = () => {return `html {- --remotion-cli-internals-blue: ${BLUE};- --remotion-cli-internals-blue-hovered: ${BLUE_HOVERED};overscroll-behavior-y: none;}@@ -105,7 +103,7 @@ const makeDefaultGlobalCSS = () => {.__remotion_thumb {appearance: none;- background: transparent;+ background: ${TRANSPARENT};border: 0;height: 100%;left: 0;@@ -120,13 +118,13 @@ const makeDefaultGlobalCSS = () => {}.__remotion_thumb::-moz-range-track {- background: transparent;+ background: ${TRANSPARENT};border: 0;height: 6px;}.__remotion_thumb::-webkit-slider-runnable-track {- background: transparent;+ background: ${TRANSPARENT};border: 0;height: 6px;}@@ -158,11 +156,11 @@ const makeDefaultGlobalCSS = () => {}.__remotion_input_dragger:hover > span:first-child {- color: var(--remotion-cli-internals-blue-hovered) !important;+ color: ${BLUE_HOVERED} !important;}.${DEFAULT_PROPS_PATH_ACTIVE_CLASSNAME} span {- color: var(--remotion-cli-internals-blue) !important;+ color: ${BLUE} !important;transition: color 0.2s ease-in-out;}diff --git a/packages/studio/src/helpers/prism-vsc-dark-plus.ts b/packages/studio/src/helpers/prism-vsc-dark-plus.tsindex 8183a4faf3..2a98d72a10 100644--- a/packages/studio/src/helpers/prism-vsc-dark-plus.ts+++ b/packages/studio/src/helpers/prism-vsc-dark-plus.ts@@ -1,6 +1,26 @@-// Unmodified [email protected]/themes/prism-vsc-dark-plus.css, stored as a-// string for Studio’s CSS injection (including Browser Studio, which has no-// CSS loader).+import {+ PRISM_BACKGROUND,+ PRISM_CLASS_NAME_COLOR,+ PRISM_COMMENT_COLOR,+ PRISM_CONTROL_FLOW_COLOR,+ PRISM_FUNCTION_COLOR,+ PRISM_INLINE_COLOR,+ PRISM_KEYWORD_COLOR,+ PRISM_LINE_HIGHLIGHT_BACKGROUND,+ PRISM_LINE_HIGHLIGHT_BORDER_COLOR,+ PRISM_NUMBER_COLOR,+ PRISM_REGEX_COLOR,+ PRISM_SELECTION_BACKGROUND,+ PRISM_SELECTOR_COLOR,+ PRISM_STRING_COLOR,+ PRISM_TEXT_COLOR,+ PRISM_VARIABLE_COLOR,+ RULER_COLOR,+} from './colors';++// Adapted from [email protected]/themes/prism-vsc-dark-plus.css to use the+// Studio palette. Stored as a string for CSS injection (including Browser+// Studio, which has no CSS loader)./*The MIT License (MIT)@@ -26,7 +46,7 @@ SOFTWARE.*/export const prismVscDarkPlus = `pre[class*="language-"],code[class*="language-"] {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};font-size: 13px;text-shadow: none;font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;@@ -50,7 +70,7 @@ code[class*="language-"]::selection,pre[class*="language-"] *::selection,code[class*="language-"] *::selection {text-shadow: none;- background: #264F78;+ background: ${PRISM_SELECTION_BACKGROUND};}@media print {@@ -64,14 +84,14 @@ pre[class*="language-"] {padding: 1em;margin: .5em 0;overflow: auto;- background: #1e1e1e;+ background: ${PRISM_BACKGROUND};}:not(pre) > code[class*="language-"] {padding: .1em .3em;border-radius: .3em;- color: #db4c69;- background: #1e1e1e;+ color: ${PRISM_INLINE_COLOR};+ background: ${PRISM_BACKGROUND};}/********************************************************** Tokens@@ -81,22 +101,22 @@ pre[class*="language-"] {}.token.doctype .token.doctype-tag {- color: #569CD6;+ color: ${PRISM_KEYWORD_COLOR};}.token.doctype .token.name {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.comment,.token.prolog {- color: #6a9955;+ color: ${PRISM_COMMENT_COLOR};}.token.punctuation,.language-html .language-css .token.punctuation,.language-html .language-javascript .token.punctuation {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};}.token.property,@@ -107,7 +127,7 @@ pre[class*="language-"] {.token.symbol,.token.inserted,.token.unit {- color: #b5cea8;+ color: ${PRISM_NUMBER_COLOR};}.token.selector,@@ -116,7 +136,7 @@ pre[class*="language-"] {.token.char,.token.builtin,.token.deleted {- color: #ce9178;+ color: ${PRISM_STRING_COLOR};}.language-css .token.string.url {@@ -125,53 +145,53 @@ pre[class*="language-"] {.token.operator,.token.entity {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};}.token.operator.arrow {- color: #569CD6;+ color: ${PRISM_KEYWORD_COLOR};}.token.atrule {- color: #ce9178;+ color: ${PRISM_STRING_COLOR};}.token.atrule .token.rule {- color: #c586c0;+ color: ${PRISM_CONTROL_FLOW_COLOR};}.token.atrule .token.url {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.atrule .token.url .token.function {- color: #dcdcaa;+ color: ${PRISM_FUNCTION_COLOR};}.token.atrule .token.url .token.punctuation {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};}.token.keyword {- color: #569CD6;+ color: ${PRISM_KEYWORD_COLOR};}.token.keyword.module,.token.keyword.control-flow {- color: #c586c0;+ color: ${PRISM_CONTROL_FLOW_COLOR};}.token.function,.token.function .token.maybe-class-name {- color: #dcdcaa;+ color: ${PRISM_FUNCTION_COLOR};}.token.regex {- color: #d16969;+ color: ${PRISM_REGEX_COLOR};}.token.important {- color: #569cd6;+ color: ${PRISM_KEYWORD_COLOR};}.token.italic {@@ -179,80 +199,80 @@ pre[class*="language-"] {}.token.constant {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.class-name,.token.maybe-class-name {- color: #4ec9b0;+ color: ${PRISM_CLASS_NAME_COLOR};}.token.console {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.parameter {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.interpolation {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.punctuation.interpolation-punctuation {- color: #569cd6;+ color: ${PRISM_KEYWORD_COLOR};}.token.boolean {- color: #569cd6;+ color: ${PRISM_KEYWORD_COLOR};}.token.property,.token.variable,.token.imports .token.maybe-class-name,.token.exports .token.maybe-class-name {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.selector {- color: #d7ba7d;+ color: ${PRISM_SELECTOR_COLOR};}.token.escape {- color: #d7ba7d;+ color: ${PRISM_SELECTOR_COLOR};}.token.tag {- color: #569cd6;+ color: ${PRISM_KEYWORD_COLOR};}.token.tag .token.punctuation {- color: #808080;+ color: ${RULER_COLOR};}.token.cdata {- color: #808080;+ color: ${RULER_COLOR};}.token.attr-name {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}.token.attr-value,.token.attr-value .token.punctuation {- color: #ce9178;+ color: ${PRISM_STRING_COLOR};}.token.attr-value .token.punctuation.attr-equals {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};}.token.entity {- color: #569cd6;+ color: ${PRISM_KEYWORD_COLOR};}.token.namespace {- color: #4ec9b0;+ color: ${PRISM_CLASS_NAME_COLOR};}/********************************************************** Language Specific@@ -266,25 +286,25 @@ pre[class*="language-typescript"],code[class*="language-typescript"],pre[class*="language-tsx"],code[class*="language-tsx"] {- color: #9cdcfe;+ color: ${PRISM_VARIABLE_COLOR};}pre[class*="language-css"],code[class*="language-css"] {- color: #ce9178;+ color: ${PRISM_STRING_COLOR};}pre[class*="language-html"],code[class*="language-html"] {- color: #d4d4d4;+ color: ${PRISM_TEXT_COLOR};}.language-regex .token.anchor {- color: #dcdcaa;+ color: ${PRISM_FUNCTION_COLOR};}.language-html .token.punctuation {- color: #808080;+ color: ${RULER_COLOR};}/********************************************************** Line highlighting@@ -295,8 +315,8 @@ pre[class*="language-"] > code[class*="language-"] {}.line-highlight.line-highlight {- background: #f7ebc6;- box-shadow: inset 5px 0 0 #f7d87c;+ background: ${PRISM_LINE_HIGHLIGHT_BACKGROUND};+ box-shadow: inset 5px 0 0 ${PRISM_LINE_HIGHLIGHT_BORDER_COLOR};z-index: 0;}`;diff --git a/packages/studio/src/helpers/resolve-studio-color.ts b/packages/studio/src/helpers/resolve-studio-color.tsnew file mode 100644index 0000000000..3f9a27e5f4--- /dev/null+++ b/packages/studio/src/helpers/resolve-studio-color.ts@@ -0,0 +1,10 @@+// Canvas and JavaScript color parsers need concrete colors rather than CSS var().+// Reuse the computed style for all colors in a draw to avoid repeated style reads.+export const resolveStudioColor = (+ color: string,+ computedStyle: CSSStyleDeclaration,+): string => {+ return color.replace(/var\((--remotion-studio-[a-z0-9-]+)\)/g, (_, name) => {+ return computedStyle.getPropertyValue(name).trim();+ });+};diff --git a/packages/studio/src/helpers/studio-css-variables.ts b/packages/studio/src/helpers/studio-css-variables.tsnew file mode 100644index 0000000000..7c0b0419f7--- /dev/null+++ b/packages/studio/src/helpers/studio-css-variables.ts@@ -0,0 +1,102 @@+// Injected in every Studio document, including standalone previews and cursors.+// Zero specificity lets a theme override defaults regardless of injection order.+export const studioCssVariables = `+:where(:root) {+ --remotion-studio-black: black;+ --remotion-studio-white: white;+ --remotion-studio-red: red;+ --remotion-studio-transparent: transparent;+ --remotion-studio-current-color: currentColor;+ --remotion-studio-background: rgb(31,36,40);+ --remotion-studio-background-transparent: rgba(31,36,40, 0);+ --remotion-studio-input-background: #2f363d;+ --remotion-studio-light-color: #ddd;+ --remotion-studio-light-text: #A6A7A9;+ --remotion-studio-ruler-color: #808080;+ --remotion-studio-white-alpha-05: rgba(255, 255, 255, 0.05);+ --remotion-studio-white-alpha-06: rgba(255, 255, 255, 0.06);+ --remotion-studio-white-alpha-08: rgba(255, 255, 255, 0.08);+ --remotion-studio-white-alpha-10: rgba(255, 255, 255, 0.1);+ --remotion-studio-white-alpha-12: rgba(255, 255, 255, 0.12);+ --remotion-studio-white-alpha-15: rgba(255, 255, 255, 0.15);+ --remotion-studio-white-alpha-20: rgba(255, 255, 255, 0.2);+ --remotion-studio-white-alpha-25: rgba(255, 255, 255, 0.25);+ --remotion-studio-white-alpha-30: rgba(255, 255, 255, 0.3);+ --remotion-studio-white-alpha-35: rgba(255, 255, 255, 0.35);+ --remotion-studio-white-alpha-40: rgba(255, 255, 255, 0.4);+ --remotion-studio-white-alpha-45: rgba(255, 255, 255, 0.45);+ --remotion-studio-white-alpha-50: rgba(255, 255, 255, 0.5);+ --remotion-studio-white-alpha-60: rgba(255, 255, 255, 0.6);+ --remotion-studio-white-alpha-70: rgba(255, 255, 255, 0.7);+ --remotion-studio-white-alpha-72: rgba(255, 255, 255, 0.72);+ --remotion-studio-white-alpha-80: rgba(255, 255, 255, 0.8);+ --remotion-studio-white-alpha-90: rgba(255, 255, 255, 0.9);+ --remotion-studio-black-alpha-10: rgba(0, 0, 0, 0.1);+ --remotion-studio-black-alpha-28: rgba(0, 0, 0, 0.28);+ --remotion-studio-black-alpha-30: rgba(0, 0, 0, 0.3);+ --remotion-studio-black-alpha-40: rgba(0, 0, 0, 0.4);+ --remotion-studio-black-alpha-50: rgba(0, 0, 0, 0.5);+ --remotion-studio-black-alpha-60: rgba(0, 0, 0, 0.6);+ --remotion-studio-black-alpha-80: rgba(0, 0, 0, 0.8);+ --remotion-studio-black-alpha-85: rgba(0, 0, 0, 0.85);+ --remotion-studio-black-alpha-90: rgba(0, 0, 0, 0.9);+ --remotion-studio-fail-color: #ff3232;+ --remotion-studio-warning-color: #f1c40f;+ --remotion-studio-blue: #0b84f3;+ --remotion-studio-blue-hovered: #4da3f7;+ --remotion-studio-blue-disabled: #284f73;+ --remotion-studio-unselected-guide: #7e1219;+ --remotion-studio-selected-guide: #d22d3a;+ --remotion-studio-line-color: #363A3E;+ --remotion-studio-timeline-track-separator: #13161B;+ --remotion-studio-light-gray: #ccc;+ --remotion-studio-keyboard-shortcut-key-color: #eee;+ --remotion-studio-notification-background: #111111;+ --remotion-studio-render-status-background: #222;+ --remotion-studio-error-code-frame-background: #070707;+ --remotion-studio-error-code-frame-line-background: #121212;+ --remotion-studio-error-link-color: #58a6ff;+ --remotion-studio-info-blue: #60a5fa;+ --remotion-studio-server-disconnected-background: #e74c3c;+ --remotion-studio-timeline-background-color: #15181B;+ --remotion-studio-timeline-negative-start-background-color: #2C2F32;+ --remotion-studio-timeline-negative-start-border-color: #414446;+ --remotion-studio-timeline-selected-background-color: #3B3F42;+ --remotion-studio-timeline-selected-label-background-color: #B0B0B0;+ --remotion-studio-timeline-blue: #0b84ff;+ --remotion-studio-timeline-playhead-color: #f02c00;+ --remotion-studio-timeline-drop-blue-alpha-12: rgba(0, 155, 255, 0.12);+ --remotion-studio-timeline-drop-blue-alpha-16: rgba(0, 155, 255, 0.16);+ --remotion-studio-timeline-drop-blue-alpha-75: rgba(0, 155, 255, 0.75);+ --remotion-studio-timeline-marquee-blue-alpha-16: rgba(70, 130, 255, 0.16);+ --remotion-studio-timeline-marquee-blue-alpha-75: rgba(70, 130, 255, 0.75);+ --remotion-studio-easing-selected-background: rgba(11, 132, 243, 0.18);+ --remotion-studio-info-blue-background: rgba(59, 130, 246, 0.15);+ --remotion-studio-color-picker-checker-background-color: #444;+ --remotion-studio-color-picker-hue-gradient: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);+ --remotion-studio-timeline-audio-gradient: linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%);+ --remotion-studio-timeline-video-gradient: linear-gradient(to top, #8e44ad, #9b59b6);+ --remotion-studio-focus-color: #555;+ --remotion-studio-color-picker-checker-color: #888;+ --remotion-studio-info-blue-border-color: rgba(59, 130, 246, 0.4);+ --remotion-studio-black-alpha-22: rgba(0, 0, 0, 0.22);+ --remotion-studio-font-family-error-color: #ff8a8a;+ --remotion-studio-selected-outline-snap-color: #ff00ff;+ --remotion-studio-prism-text-color: #d4d4d4;+ --remotion-studio-prism-selection-background: #264f78;+ --remotion-studio-prism-background: #1e1e1e;+ --remotion-studio-prism-inline-color: #db4c69;+ --remotion-studio-prism-keyword-color: #569cd6;+ --remotion-studio-prism-variable-color: #9cdcfe;+ --remotion-studio-prism-comment-color: #6a9955;+ --remotion-studio-prism-number-color: #b5cea8;+ --remotion-studio-prism-string-color: #ce9178;+ --remotion-studio-prism-control-flow-color: #c586c0;+ --remotion-studio-prism-function-color: #dcdcaa;+ --remotion-studio-prism-regex-color: #d16969;+ --remotion-studio-prism-class-name-color: #4ec9b0;+ --remotion-studio-prism-selector-color: #d7ba7d;+ --remotion-studio-prism-line-highlight-background: #f7ebc6;+ --remotion-studio-prism-line-highlight-border-color: #f7d87c;+}+`;diff --git a/packages/studio/src/hot-middleware-client/client.ts b/packages/studio/src/hot-middleware-client/client.tsindex 1b7cea2045..10d8925dee 100644--- a/packages/studio/src/hot-middleware-client/client.ts+++ b/packages/studio/src/hot-middleware-client/client.ts@@ -10,10 +10,6 @@import type {HotMiddlewareMessage} from '@remotion/studio-shared';import {hotMiddlewareOptions, stripAnsi} from '@remotion/studio-shared';import {markErrorMessageAsLoggedByServer} from '../error-overlay/error-origin';-import {- HOT_MIDDLEWARE_ERROR_STYLE,- HOT_MIDDLEWARE_WARNING_STYLE,-} from '../helpers/colors';import {subscribeToPreviewServerEvents} from '../helpers/preview-server-events';import {processUpdate} from './process-update';@@ -26,6 +22,10 @@ declare global {type Reporter = ReturnType<typeof createReporter>;+// DevTools console styles cannot inherit CSS variables from the page.+const HOT_MIDDLEWARE_ERROR_STYLE = 'color: #ff0000;';+const HOT_MIDDLEWARE_WARNING_STYLE = 'color: #999933;';+function createReporter() {const styles = {errors: HOT_MIDDLEWARE_ERROR_STYLE,diff --git a/packages/studio/src/icons/align-center-horizontal.tsx b/packages/studio/src/icons/align-center-horizontal.tsxindex 19cd21f814..8481ce5961 100644--- a/packages/studio/src/icons/align-center-horizontal.tsx+++ b/packages/studio/src/icons/align-center-horizontal.tsx@@ -1,10 +1,11 @@import type {SVGProps} from 'react';import React from 'react';+import {CURRENT_COLOR} from '../helpers/colors';export const AlignCenterHorizontalIcon: React.FC<SVGProps<SVGSVGElement>> = (props,) => {- const color = props.color ?? 'currentColor';+ const color = props.color ?? CURRENT_COLOR;return (<svgdiff --git a/packages/studio/src/icons/align-left.tsx b/packages/studio/src/icons/align-left.tsxindex 311a0b38b2..5dcdfada08 100644--- a/packages/studio/src/icons/align-left.tsx+++ b/packages/studio/src/icons/align-left.tsx@@ -1,8 +1,9 @@import type {SVGProps} from 'react';import React from 'react';+import {CURRENT_COLOR} from '../helpers/colors';export const AlignLeftIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {- const color = props.color ?? 'currentColor';+ const color = props.color ?? CURRENT_COLOR;return (<svg {...props} viewBox="0 0 16 16" fill="none">diff --git a/packages/studio/src/icons/align-right.tsx b/packages/studio/src/icons/align-right.tsxindex f3d9f1a02e..36a6390c9e 100644--- a/packages/studio/src/icons/align-right.tsx+++ b/packages/studio/src/icons/align-right.tsx@@ -1,8 +1,9 @@import type {SVGProps} from 'react';import React from 'react';+import {CURRENT_COLOR} from '../helpers/colors';export const AlignRightIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {- const color = props.color ?? 'currentColor';+ const color = props.color ?? CURRENT_COLOR;return (<svg {...props} viewBox="0 0 16 16" fill="none">diff --git a/packages/studio/src/previewEntry.tsx b/packages/studio/src/previewEntry.tsxindex ccb14e0a69..b4968c5fc3 100644--- a/packages/studio/src/previewEntry.tsx+++ b/packages/studio/src/previewEntry.tsx@@ -6,11 +6,13 @@ import {NoRegisterRoot} from './components/NoRegisterRoot';import {startErrorOverlay} from './error-overlay/entry-basic';import {BACKGROUND_HEX} from './helpers/colors';import {installFiberCommitOrderObserver} from './helpers/install-fiber-sequence-order-observer';+import {studioCssVariables} from './helpers/studio-css-variables';import {enableHotMiddleware} from './hot-middleware-client/client';import {Studio} from './Studio';installFiberCommitOrderObserver(window);+Internals.CSSUtils.injectCSS(studioCssVariables);Internals.CSSUtils.injectCSS(Internals.CSSUtils.makeDefaultPreviewCSS(null, BACKGROUND_HEX),);diff --git a/packages/studio/src/renderEntry.tsx b/packages/studio/src/renderEntry.tsxindex b5fc821597..44e517c21f 100644--- a/packages/studio/src/renderEntry.tsx+++ b/packages/studio/src/renderEntry.tsx@@ -26,6 +26,7 @@ import {} from 'remotion';import {NoReactInternals} from 'remotion/no-react';import {BACKGROUND_HEX, TRANSPARENT, WHITE} from './helpers/colors';+import {studioCssVariables} from './helpers/studio-css-variables';let currentBundleMode: BundleState = {type: 'index',@@ -39,6 +40,7 @@ const getBundleMode = () => {return currentBundleMode;};+Internals.CSSUtils.injectCSS(studioCssVariables);Internals.CSSUtils.injectCSS(Internals.CSSUtils.makeDefaultPreviewCSS(null, BACKGROUND_HEX),);diff --git a/packages/studio/src/test/queue-job-errors.test.tsx b/packages/studio/src/test/queue-job-errors.test.tsxindex f3aff3b945..1a904e7033 100644--- a/packages/studio/src/test/queue-job-errors.test.tsx+++ b/packages/studio/src/test/queue-job-errors.test.tsx@@ -15,7 +15,7 @@ import {RenderQueueContext} from '../components/RenderQueue/context';import {QueueJobErrorModal} from '../components/RenderQueue/QueueJobErrorModal';import type {VideoMattingJob} from '../components/RenderQueue/video-matting-job-types';import {VideoMattingQueueItem} from '../components/RenderQueue/VideoMattingQueueItem';-import {LIGHT_TEXT} from '../helpers/colors';+import {studioCssVariables} from '../helpers/studio-css-variables';import {SelectedModalContext} from '../state/modals';const originalClipboard = Object.getOwnPropertyDescriptor(@@ -97,6 +97,7 @@ test('opens and copies transcription and video matting errors', async () => {render(<ModalsProvider>+ <style>{studioCssVariables}</style><RenderQueueContext.Providervalue={{@@ -123,7 +124,7 @@ test('opens and copies transcription and video matting errors', async () => {'The job failed because of the following error:',);const descriptionStyle = getComputedStyle(description);- expect(descriptionStyle.color).toBe(LIGHT_TEXT);+ expect(descriptionStyle.color).toBe('#A6A7A9');expect(descriptionStyle.fontFamily).toBe('sans-serif');expect(descriptionStyle.fontSize).toBe('14px');expect(descriptionStyle.lineHeight).toBe('1.5');diff --git a/packages/studio/src/test/timeline-selection.test.ts b/packages/studio/src/test/timeline-selection.test.tsindex dde49fc1d1..d31283dffd 100644--- a/packages/studio/src/test/timeline-selection.test.ts+++ b/packages/studio/src/test/timeline-selection.test.ts@@ -3473,8 +3473,10 @@ test('Timeline from drag removes the prop at the default value', () => {});});-test('Timeline colors use the outlines palette', () => {- expect(TIMELINE_BACKGROUND).toBe('#15181B');+test('Timeline colors use the Studio palette', () => {+ expect(TIMELINE_BACKGROUND).toBe(+ 'var(--remotion-studio-timeline-background-color)',+ );expect(TIMELINE_TICKS_BACKGROUND).not.toBe(TIMELINE_BACKGROUND);});