Skip to content

🎥 Make videos programmatically with React

Elements: Show embedded libraries in dark mode

Igor Samokhovets1b8f2e6ec4fb
diff --git a/packages/example/e2e/studio-protocol.test.mts b/packages/example/e2e/studio-protocol.test.mts
index 00c1db8d86..0ae76005fa 100644
--- a/packages/example/e2e/studio-protocol.test.mts
+++ b/packages/example/e2e/studio-protocol.test.mts
@@ -222,7 +222,7 @@ const CloseupPlaceholder = () => {
}
});
await context.route(
- 'https://www.remotion.dev/elements?remotion-studio=true',
+ 'https://www.remotion.dev/elements?remotion-studio=true&docusaurus-theme=dark',
async (route) => {
officialLibraryRequests.push(route.request().url());
await route.fulfill({
@@ -232,7 +232,7 @@ const CloseupPlaceholder = () => {
},
);
await context.route(
- `${externalLibraryUrl}?remotion-studio=true`,
+ `${externalLibraryUrl}?remotion-studio=true&docusaurus-theme=dark`,
async (route) => {
externalLibraryRequests.push(route.request().url());
await route.fulfill({
@@ -311,7 +311,7 @@ const CloseupPlaceholder = () => {
);
await expect(officialElementsIframe).toBeVisible();
expect(officialLibraryRequests).toEqual([
- 'https://www.remotion.dev/elements?remotion-studio=true',
+ 'https://www.remotion.dev/elements?remotion-studio=true&docusaurus-theme=dark',
]);
expect(context.pages()).toHaveLength(2);
await studioPage.keyboard.press('Escape');
@@ -339,7 +339,7 @@ const CloseupPlaceholder = () => {
);
await expect(elementsIframe).toHaveAttribute('credentialless', '');
expect(externalLibraryRequests).toEqual([
- `${externalLibraryUrl}?remotion-studio=true`,
+ `${externalLibraryUrl}?remotion-studio=true&docusaurus-theme=dark`,
]);
expect(context.pages()).toHaveLength(2);
const elementsFrame = studioPage.frameLocator(
diff --git a/packages/studio/src/components/ElementLibraryModal.tsx b/packages/studio/src/components/ElementLibraryModal.tsx
index 6fc9969e09..4dfc478732 100644
--- a/packages/studio/src/components/ElementLibraryModal.tsx
+++ b/packages/studio/src/components/ElementLibraryModal.tsx
@@ -13,6 +13,7 @@ const panelStyle: React.CSSProperties = {
const iframeStyle: React.CSSProperties = {
border: 0,
+ colorScheme: 'dark',
flex: 1,
minHeight: 0,
width: '100%',
@@ -35,6 +36,7 @@ export const ElementLibraryModal: React.FC<{
iframe.setAttribute('credentialless', '');
const iframeUrl = new URL(url);
iframeUrl.searchParams.set('remotion-studio', 'true');
+ iframeUrl.searchParams.set('docusaurus-theme', 'dark');
iframe.src = iframeUrl.toString();
}, [url]);