Skip to content

🎥 Make videos programmatically with React

test composition

Jonny Burger7c0d53a25437
diff --git a/packages/example/src/DarkModeTest/index.tsx b/packages/example/src/DarkModeTest/index.tsx
new file mode 100644
index 0000000000..0b6f55cbbf
--- /dev/null
+++ b/packages/example/src/DarkModeTest/index.tsx
@@ -0,0 +1,14 @@
+import React from 'react';
+import {AbsoluteFill} from 'remotion';
+import styles from './styles.module.css';
+
+export const DarkModeTest: React.FC = () => {
+ return (
+ <AbsoluteFill className={styles.container}>
+ <div className={styles.title}>Dark Mode Test</div>
+ <div className={styles.subtitle}>
+ Theme switches automatically based on system preferences
+ </div>
+ </AbsoluteFill>
+ );
+};
diff --git a/packages/example/src/DarkModeTest/styles.module.css b/packages/example/src/DarkModeTest/styles.module.css
new file mode 100644
index 0000000000..0955cefa41
--- /dev/null
+++ b/packages/example/src/DarkModeTest/styles.module.css
@@ -0,0 +1,33 @@
+.container {
+ background-color: #ffffff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ gap: 20px;
+}
+
+.title {
+ font-size: 48px;
+ font-weight: bold;
+ color: #000000;
+}
+
+.subtitle {
+ font-size: 24px;
+ color: #333333;
+}
+
+@media (prefers-color-scheme: dark) {
+ .container {
+ background-color: #1a1a1a;
+ }
+
+ .title {
+ color: #ffffff;
+ }
+
+ .subtitle {
+ color: #cccccc;
+ }
+}
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index f5bbfcd48f..927bb00a2b 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -24,6 +24,7 @@ import {ColorInterpolation} from './ColorInterpolation';
import {ComplexSounds} from './ComplexSounds';
import {MyCtx, WrappedInContext} from './Context';
import CorruptVideo from './CorruptVideo';
+import {DarkModeTest} from './DarkModeTest';
import {DecoderDemo} from './DecoderDemo';
import {DynamicDuration, dynamicDurationSchema} from './DynamicDuration';
import {EmojiTestbed} from './Emoji';
@@ -906,6 +907,12 @@ export const Index: React.FC = () => {
width={1080}
height={1080}
/>
+ <Still
+ id="dark-mode-test"
+ component={DarkModeTest}
+ width={1080}
+ height={1080}
+ />
<Composition
id="color-interpolation"
component={ColorInterpolation}