🎥 Make videos programmatically with React
remove --blue css variable
Jonny Burgerb4aac82a39b2
diff --git a/packages/cli/src/editor/components/CheckboardToggle.tsx b/packages/cli/src/editor/components/CheckboardToggle.tsxindex decc544901..59f15dc189 100644--- a/packages/cli/src/editor/components/CheckboardToggle.tsx+++ b/packages/cli/src/editor/components/CheckboardToggle.tsx@@ -1,5 +1,6 @@import React, {useCallback, useContext} from 'react';import {truthy} from '../../truthy';+import {BLUE} from '../helpers/colors';import {areKeyboardShortcutsDisabled} from '../helpers/use-keybinding';import {CheckerboardContext} from '../state/checkerboard';import {ControlButton} from './ControlButton';@@ -38,7 +39,7 @@ export const CheckboardToggle: React.FC = () => {style={{width: 16, height: 16}}><path- fill={checkerboard ? 'var(--blue)' : 'white'}+ fill={checkerboard ? BLUE : 'white'}d="M480 0H32A32 32 0 0 0 0 32v448a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V32a32 32 0 0 0-32-32zm-32 256H256v192H64V256h192V64h192z"/></svg>diff --git a/packages/cli/src/editor/components/LoopToggle.tsx b/packages/cli/src/editor/components/LoopToggle.tsxindex 644dd6c926..ad1acf68fd 100644--- a/packages/cli/src/editor/components/LoopToggle.tsx+++ b/packages/cli/src/editor/components/LoopToggle.tsx@@ -1,4 +1,5 @@import React, {useCallback} from 'react';+import {BLUE} from '../helpers/colors';import {useIsStill} from '../helpers/is-current-selected-still';import {persistLoopOption} from '../state/loop';import {ControlButton} from './ControlButton';@@ -30,7 +31,7 @@ export const LoopToggle: React.FC<{><svg viewBox="0 0 512 512" style={{width: 18, height: 18}}><path- fill={loop ? 'var(--blue)' : 'white'}+ fill={loop ? BLUE : 'white'}d="M493.544 181.463c11.956 22.605 18.655 48.4 18.452 75.75C511.339 345.365 438.56 416 350.404 416H192v47.495c0 22.475-26.177 32.268-40.971 17.475l-80-80c-9.372-9.373-9.372-24.569 0-33.941l80-80C166.138 271.92 192 282.686 192 304v48h158.875c52.812 0 96.575-42.182 97.12-94.992.155-15.045-3.17-29.312-9.218-42.046-4.362-9.185-2.421-20.124 4.8-27.284 4.745-4.706 8.641-8.555 11.876-11.786 11.368-11.352 30.579-8.631 38.091 5.571zM64.005 254.992c.545-52.81 44.308-94.992 97.12-94.992H320v47.505c0 22.374 26.121 32.312 40.971 17.465l80-80c9.372-9.373 9.372-24.569 0-33.941l-80-80C346.014 16.077 320 26.256 320 48.545V96H161.596C73.44 96 .661 166.635.005 254.788c-.204 27.35 6.495 53.145 18.452 75.75 7.512 14.202 26.723 16.923 38.091 5.57 3.235-3.231 7.13-7.08 11.876-11.786 7.22-7.16 9.162-18.098 4.8-27.284-6.049-12.735-9.374-27.001-9.219-42.046z"/></svg>diff --git a/packages/cli/src/editor/components/NewComposition/InputDragger.tsx b/packages/cli/src/editor/components/NewComposition/InputDragger.tsxindex 4ba541567d..e5339fa2b7 100644--- a/packages/cli/src/editor/components/NewComposition/InputDragger.tsx+++ b/packages/cli/src/editor/components/NewComposition/InputDragger.tsx@@ -5,6 +5,7 @@ import type {} from 'react';import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';import {interpolate} from 'remotion';+import {BLUE} from '../../helpers/colors';import {noop} from '../../helpers/noop';import {getClickLock, setClickLock} from '../../state/input-dragger-click-lock';import {HigherZIndex} from '../../state/z-index';@@ -43,9 +44,9 @@ export const InputDragger: React.FC<Props> = ({const span: React.CSSProperties = useMemo(() => ({- borderBottom: '1px dotted var(--blue)',+ borderBottom: '1px dotted ' + BLUE,paddingBottom: 1,- color: 'var(--blue)',+ color: BLUE,cursor: 'ew-resize',userSelect: 'none',fontSize: 13,diff --git a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx b/packages/cli/src/editor/components/RenderModal/RenderModal.tsxindex 199ff11120..bfd90c9921 100644--- a/packages/cli/src/editor/components/RenderModal/RenderModal.tsx+++ b/packages/cli/src/editor/components/RenderModal/RenderModal.tsx@@ -38,6 +38,7 @@ import {PicIcon} from '../../icons/frame';import {GearIcon} from '../../icons/gear';import {GifIcon} from '../../icons/gif';+import {BLUE, BLUE_DISABLED} from '../../helpers/colors';import {ModalsContext} from '../../state/modals';import {SidebarContext} from '../../state/sidebar';import {VERTICAL_SCROLLBAR_CLASSNAME} from '../Menu/is-menu-item';@@ -164,7 +165,7 @@ const icon: React.CSSProperties = {};const buttonStyle: React.CSSProperties = {- backgroundColor: 'var(--blue)',+ backgroundColor: BLUE,color: 'white',};@@ -900,9 +901,7 @@ export const RenderModal: React.FC<{disabled={renderDisabled}style={{...buttonStyle,- backgroundColor: outnameValidation.valid- ? 'var(--blue)'- : 'var(--blue-disabled)',+ backgroundColor: outnameValidation.valid ? BLUE : BLUE_DISABLED,}}>{state.type === 'idle' ? `Render ${renderMode}` : 'Rendering...'}diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsxindex 55380f5e6f..5791a8edaa 100644--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.tsx@@ -1,6 +1,6 @@import type {z} from 'zod';import {Button} from '../../../../preview-server/error-overlay/remotion-overlay/Button';-import {LIGHT_TEXT} from '../../../helpers/colors';+import {BLUE, LIGHT_TEXT} from '../../../helpers/colors';import {Spacing} from '../../layout';import {SchemaEmptyStateGraphic} from './SchemaEmptyStateGraphic';import {ZodErrorMessages} from './ZodErrorMessages';@@ -24,7 +24,7 @@ const errorExplanation: React.CSSProperties = {const codeSnippet: React.CSSProperties = {fontSize: 14,- color: 'var(--blue)',+ color: BLUE,fontFamily: 'monospace',};diff --git a/packages/cli/src/editor/components/Tabs/index.tsx b/packages/cli/src/editor/components/Tabs/index.tsxindex 915888304e..a05db29890 100644--- a/packages/cli/src/editor/components/Tabs/index.tsx+++ b/packages/cli/src/editor/components/Tabs/index.tsx@@ -1,5 +1,10 @@import React, {useCallback, useMemo, useState} from 'react';-import {CLEAR_HOVER, INPUT_BACKGROUND, LIGHT_TEXT} from '../../helpers/colors';+import {+ BLUE,+ CLEAR_HOVER,+ INPUT_BACKGROUND,+ LIGHT_TEXT,+} from '../../helpers/colors';import {useZIndex} from '../../state/z-index';const tabsContainer: React.CSSProperties = {@@ -50,8 +55,8 @@ export const Tab: React.FC<{setHovered(false);}, []);- const definiteStyle: React.CSSProperties = useMemo(() => {- return {+ const definiteStyle: React.CSSProperties = useMemo(+ () => ({...selectorButton,backgroundColor: selected? 'transparent'@@ -59,11 +64,12 @@ export const Tab: React.FC<{? CLEAR_HOVER: INPUT_BACKGROUND,color: selected ? 'white' : LIGHT_TEXT,- borderTop: selected ? '2px solid var(--blue)' : '2px solid transparent',+ borderTop: selected ? '2px solid ' + BLUE : '2px solid transparent',boxShadow: selected ? 'none' : undefined,...style,- };- }, [hovered, selected, style]);+ }),+ [hovered, selected, style]+ );return (<buttondiff --git a/packages/cli/src/editor/components/Timeline/TimelineSequence.tsx b/packages/cli/src/editor/components/Timeline/TimelineSequence.tsxindex a541596426..838e2e370d 100644--- a/packages/cli/src/editor/components/Timeline/TimelineSequence.tsx+++ b/packages/cli/src/editor/components/Timeline/TimelineSequence.tsx@@ -2,6 +2,7 @@ import {PlayerInternals} from '@remotion/player';import React, {useMemo, useState} from 'react';import type {TSequence} from 'remotion';import {Internals} from 'remotion';+import {BLUE} from '../../helpers/colors';import {getTimelineSequenceLayout,SEQUENCE_BORDER_WIDTH,@@ -12,7 +13,6 @@ import {LoopedTimelineIndicator} from './LoopedTimelineIndicators';import {sliderAreaRef} from './timeline-refs';import {TimelineVideoInfo} from './TimelineVideoInfo';-const SEQUENCE_GRADIENT = 'var(--blue)';const AUDIO_GRADIENT = 'linear-gradient(rgb(16 171 58), rgb(43 165 63) 60%)';const VIDEO_GRADIENT = 'linear-gradient(to top, #8e44ad, #9b59b6)';@@ -55,7 +55,7 @@ export const TimelineSequence: React.FC<{? AUDIO_GRADIENT: s.type === 'video'? VIDEO_GRADIENT- : SEQUENCE_GRADIENT,+ : BLUE,border: SEQUENCE_BORDER_WIDTH + 'px solid rgba(255, 255, 255, 0.2)',borderRadius: 4,position: 'absolute',diff --git a/packages/cli/src/editor/components/TimelineInOutToggle.tsx b/packages/cli/src/editor/components/TimelineInOutToggle.tsxindex 3bf5c75d54..ecd40a1819 100644--- a/packages/cli/src/editor/components/TimelineInOutToggle.tsx+++ b/packages/cli/src/editor/components/TimelineInOutToggle.tsx@@ -7,6 +7,7 @@ import React, {} from 'react';import {Internals} from 'remotion';import {truthy} from '../../truthy';+import {BLUE} from '../helpers/colors';import {useIsStill} from '../helpers/is-current-selected-still';import {areKeyboardShortcutsDisabled,@@ -305,7 +306,7 @@ export const TimelineInOutPointToggle: React.FC = () => {disabled={timelinePosition === 0}><TimelineInPointer- color={inFrame === null ? 'white' : 'var(--blue)'}+ color={inFrame === null ? 'white' : BLUE}style={style}/></ControlButton>@@ -317,7 +318,7 @@ export const TimelineInOutPointToggle: React.FC = () => {disabled={timelinePosition === videoConfig.durationInFrames - 1}><TimelineOutPointer- color={outFrame === null ? 'white' : 'var(--blue)'}+ color={outFrame === null ? 'white' : BLUE}style={style}/></ControlButton>diff --git a/packages/cli/src/editor/components/UpdateCheck.tsx b/packages/cli/src/editor/components/UpdateCheck.tsxindex fe57717d48..de2a70ebb0 100644--- a/packages/cli/src/editor/components/UpdateCheck.tsx+++ b/packages/cli/src/editor/components/UpdateCheck.tsx@@ -1,5 +1,6 @@import React, {useCallback, useContext, useEffect, useState} from 'react';import type {PackageManager} from '../../preview-server/get-package-manager';+import {BLUE} from '../helpers/colors';import {ModalsContext} from '../state/modals';import {useZIndex} from '../state/z-index';@@ -13,7 +14,7 @@ export type UpdateInfo = {const buttonStyle: React.CSSProperties = {appearance: 'none',- color: 'var(--blue)',+ color: BLUE,border: 'none',fontWeight: 'bold',backgroundColor: 'transparent',diff --git a/packages/cli/src/editor/helpers/colors.ts b/packages/cli/src/editor/helpers/colors.tsindex 94ff538fcb..457f354ae1 100644--- a/packages/cli/src/editor/helpers/colors.ts+++ b/packages/cli/src/editor/helpers/colors.ts@@ -12,6 +12,8 @@ export const INPUT_BORDER_COLOR_HOVERED = 'rgba(255, 255, 255, 0.05)';export const TIMELINE_BACKGROUND = '#111';export const FAIL_COLOR = '#ff3232';export const WARNING_COLOR = '#f1c40f';+export const BLUE = '#0b84f3';+export const BLUE_DISABLED = '#284f73';export const getBackgroundFromHoverState = ({selected,diff --git a/packages/cli/src/editor/icons/media-volume.tsx b/packages/cli/src/editor/icons/media-volume.tsxindex b6317f4e26..8314897058 100644--- a/packages/cli/src/editor/icons/media-volume.tsx+++ b/packages/cli/src/editor/icons/media-volume.tsx@@ -1,10 +1,12 @@+import {BLUE} from '../helpers/colors';+const size = 25;export const VolumeOffIcon: React.FC = () => {return (<svg width={size} height={size} viewBox="0 0 24 24"><pathd="M3.63 3.63a.996.996 0 000 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 101.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29l-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0014 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"- fill="var(--blue)"+ fill={BLUE}/></svg>);diff --git a/packages/cli/src/preview-server/error-overlay/remotion-overlay/HelpLink.tsx b/packages/cli/src/preview-server/error-overlay/remotion-overlay/HelpLink.tsxindex 7c076847d6..eed5e791d4 100644--- a/packages/cli/src/preview-server/error-overlay/remotion-overlay/HelpLink.tsx+++ b/packages/cli/src/preview-server/error-overlay/remotion-overlay/HelpLink.tsx@@ -1,11 +1,12 @@import React, {useCallback, useEffect} from 'react';+import {BLUE} from '../../../editor/helpers/colors';import {useKeybinding} from '../../../editor/helpers/use-keybinding';import {Button} from './Button';import type {THelpLink} from './get-help-link';import {ShortcutHint} from './ShortcutHint';const buttonStyle: React.CSSProperties = {- backgroundColor: 'var(--blue)',+ backgroundColor: BLUE,color: 'white',};diff --git a/packages/cli/styles/styles.css b/packages/cli/styles/styles.cssindex 300d32f9e2..07ee9b02b3 100644--- a/packages/cli/styles/styles.css+++ b/packages/cli/styles/styles.css@@ -1,6 +1,5 @@html {- --blue: #0b84f3;- --blue-disabled: #284f73;+ --remotion-cli-internals-blue: #0b84f3;}body {@@ -18,7 +17,7 @@ body {.remotion-splitter:hover,.remotion-splitter-active {- background-color: var(--blue);+ background-color: var(--remotion-cli-internals-blue);}input::-webkit-outer-spin-button,@@ -37,9 +36,9 @@ a:focus {border-radius: 0 !important;}-input[type="color"].__remotion_color_picker::-webkit-color-swatch-wrapper {+input[type='color'].__remotion_color_picker::-webkit-color-swatch-wrapper {padding: 0;}-input[type="color"].__remotion_color_picker::-webkit-color-swatch {+input[type='color'].__remotion_color_picker::-webkit-color-swatch {border: none;}