Skip to content

🎥 Make videos programmatically with React

fix weird CSS things

Jonny Burgerff9ada2851e4
diff --git a/packages/cli/src/editor/components/CanvasOrLoading.tsx b/packages/cli/src/editor/components/CanvasOrLoading.tsx
index 4a2c615ebd..9affa86315 100644
--- a/packages/cli/src/editor/components/CanvasOrLoading.tsx
+++ b/packages/cli/src/editor/components/CanvasOrLoading.tsx
@@ -1,5 +1,6 @@
import React, {useContext} from 'react';
import {Internals} from 'remotion';
+import {BACKGROUND} from '../helpers/colors';
import {Canvas} from './Canvas';
import {Spinner} from './Spinner';
@@ -9,6 +10,7 @@ const container: React.CSSProperties = {
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
+ backgroundColor: BACKGROUND,
};
export const CanvasOrLoading: React.FC = () => {
@@ -16,7 +18,7 @@ export const CanvasOrLoading: React.FC = () => {
if (!resolved) {
return (
- <div style={container}>
+ <div style={container} className="css-reset">
<Spinner size={30} duration={1} />
</div>
);
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
index ce6e82787d..8e63a2c554 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModalData.tsx
@@ -9,7 +9,7 @@ import type {AnyComposition} from 'remotion';
import {getInputProps, Internals} from 'remotion';
import type {z} from 'zod';
import {PreviewServerConnectionCtx} from '../../helpers/client-id';
-import {BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
+import {BACKGROUND, BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
import {useZodIfPossible} from '../get-zod-if-possible';
import {Flex, Spacing} from '../layout';
import {ValidationMessage} from '../NewComposition/ValidationMessage';
@@ -82,6 +82,7 @@ const outer: React.CSSProperties = {
flexDirection: 'column',
flex: 1,
overflow: 'hidden',
+ backgroundColor: BACKGROUND,
};
const controlContainer: React.CSSProperties = {
diff --git a/packages/cli/src/editor/components/RenderQueue/index.tsx b/packages/cli/src/editor/components/RenderQueue/index.tsx
index 9637815d1e..94fa27b1d5 100644
--- a/packages/cli/src/editor/components/RenderQueue/index.tsx
+++ b/packages/cli/src/editor/components/RenderQueue/index.tsx
@@ -1,7 +1,8 @@
import React, {useContext} from 'react';
import {PreviewServerConnectionCtx} from '../../helpers/client-id';
-import {BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
+import {BACKGROUND, BORDER_COLOR, LIGHT_TEXT} from '../../helpers/colors';
import {Spacing} from '../layout';
+import {VERTICAL_SCROLLBAR_CLASSNAME} from '../Menu/is-menu-item';
import {RenderQueueContext} from './context';
import {RenderQueueItem} from './RenderQueueItem';
@@ -24,6 +25,13 @@ const explainer: React.CSSProperties = {
justifyContent: 'center',
alignItems: 'center',
textAlign: 'center',
+ background: BACKGROUND,
+};
+
+const renderQueue: React.CSSProperties = {
+ background: BACKGROUND,
+ flex: 1,
+ overflowY: 'auto',
};
export const RenderQueue: React.FC = () => {
@@ -52,7 +60,10 @@ export const RenderQueue: React.FC = () => {
}
return (
- <div>
+ <div
+ style={renderQueue}
+ className={['css-reset', VERTICAL_SCROLLBAR_CLASSNAME].join(' ')}
+ >
{jobs.map((j, index) => {
return (
<div
diff --git a/packages/cli/src/editor/components/RightPanel.tsx b/packages/cli/src/editor/components/RightPanel.tsx
index cb0c950a78..cccd4e2b92 100644
--- a/packages/cli/src/editor/components/RightPanel.tsx
+++ b/packages/cli/src/editor/components/RightPanel.tsx
@@ -8,6 +8,7 @@ import React, {
} from 'react';
import type {AnyComposition} from 'remotion';
import {Internals} from 'remotion';
+import {BACKGROUND} from '../helpers/colors';
import {RenderModalData} from './RenderModal/RenderModalData';
import {RenderQueue} from './RenderQueue';
import {RendersTab} from './RendersTab';
@@ -62,7 +63,9 @@ const getSelectedPanel = (): SidebarPanel => {
return 'input-props';
};
-const tabsContainer: React.CSSProperties = {};
+const tabsContainer: React.CSSProperties = {
+ backgroundColor: BACKGROUND,
+};
export const persistSelectedPanel = (panel: SidebarPanel) => {
localStorage.setItem(localStorageKey, panel);
diff --git a/packages/cli/src/editor/components/Tabs/index.tsx b/packages/cli/src/editor/components/Tabs/index.tsx
index 915888304e..9cd6c1a55c 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 {
+ BACKGROUND,
+ CLEAR_HOVER,
+ INPUT_BACKGROUND,
+ LIGHT_TEXT,
+} from '../../helpers/colors';
import {useZIndex} from '../../state/z-index';
const tabsContainer: React.CSSProperties = {
@@ -54,7 +59,7 @@ export const Tab: React.FC<{
return {
...selectorButton,
backgroundColor: selected
- ? 'transparent'
+ ? BACKGROUND
: hovered
? CLEAR_HOVER
: INPUT_BACKGROUND,
diff --git a/packages/cli/src/editor/components/Timeline/Timeline.tsx b/packages/cli/src/editor/components/Timeline/Timeline.tsx
index 88924b557e..cab6ebdbe7 100644
--- a/packages/cli/src/editor/components/Timeline/Timeline.tsx
+++ b/packages/cli/src/editor/components/Timeline/Timeline.tsx
@@ -6,6 +6,7 @@ import React, {
} from 'react';
import {Internals} from 'remotion';
import {calculateTimeline} from '../../helpers/calculate-timeline';
+import {BACKGROUND} from '../../helpers/colors';
import type {TrackWithHash} from '../../helpers/get-timeline-sequence-sort-key';
import {
TIMELINE_BORDER,
@@ -37,6 +38,7 @@ const container: React.CSSProperties = {
display: 'flex',
height: 0,
overflowY: 'auto',
+ backgroundColor: BACKGROUND,
};
const noop = () => undefined;
@@ -112,7 +114,7 @@ export const Timeline: React.FC = () => {
}, [hasBeenCut, shown.length]);
if (!videoConfig) {
- return null;
+ return <div style={container} className="css-reset" />;
}
return (