Skip to content

🎥 Make videos programmatically with React

add tailwind

Jonny Burger4ac5f98c4805
diff --git a/packages/template-react-router/app/app.css b/packages/template-react-router/app/app.css
new file mode 100644
index 0000000000..f1d8c73cdc
--- /dev/null
+++ b/packages/template-react-router/app/app.css
@@ -0,0 +1 @@
+@import "tailwindcss";
diff --git a/packages/template-react-router/app/home.tsx b/packages/template-react-router/app/home.tsx
index 0bbd0de7b3..faa763ac30 100644
--- a/packages/template-react-router/app/home.tsx
+++ b/packages/template-react-router/app/home.tsx
@@ -4,14 +4,14 @@ import { RenderProgress } from "./components/render-progress";
import { renderVideo } from "./lib/render-video.server";
import {
SITE_NAME,
- COMPOSITION_DURATION_IN_FRAMES,
+ DURATION_IN_FRAMES,
COMPOSITION_FPS,
COMPOSITION_HEIGHT,
COMPOSITION_ID,
COMPOSITION_WIDTH,
CompositionProps,
} from "./remotion/constants";
-import stylesHref from "./styles/layout.css?url";
+import stylesHref from "./app.css";
import type { RenderResponse } from "./lib/types";
import { ActionFunction, LinksFunction, useFetcher } from "react-router";
import { z } from "zod";
@@ -92,12 +92,12 @@ export default function Index() {
}, [title]);
return (
- <div style={container} className="container">
+ <div style={container}>
<div style={playerContainer}>
<Player
component={Main}
inputProps={inputProps}
- durationInFrames={COMPOSITION_DURATION_IN_FRAMES}
+ durationInFrames={DURATION_IN_FRAMES}
fps={COMPOSITION_FPS}
compositionWidth={COMPOSITION_WIDTH}
compositionHeight={COMPOSITION_HEIGHT}
diff --git a/packages/template-react-router/app/remotion/Root.tsx b/packages/template-react-router/app/remotion/Root.tsx
index c813e33091..04baeeecb5 100644
--- a/packages/template-react-router/app/remotion/Root.tsx
+++ b/packages/template-react-router/app/remotion/Root.tsx
@@ -1,6 +1,6 @@
import { Composition } from "remotion";
import {
- COMPOSITION_DURATION_IN_FRAMES,
+ DURATION_IN_FRAMES,
COMPOSITION_FPS,
COMPOSITION_HEIGHT,
COMPOSITION_ID,
@@ -14,7 +14,7 @@ export const RemotionRoot = () => {
<Composition
id={COMPOSITION_ID}
component={Main}
- durationInFrames={COMPOSITION_DURATION_IN_FRAMES}
+ durationInFrames={DURATION_IN_FRAMES}
fps={COMPOSITION_FPS}
width={COMPOSITION_WIDTH}
height={COMPOSITION_HEIGHT}
diff --git a/packages/template-react-router/app/remotion/constants.ts b/packages/template-react-router/app/remotion/constants.ts
index ba247e80d3..103ade2620 100644
--- a/packages/template-react-router/app/remotion/constants.ts
+++ b/packages/template-react-router/app/remotion/constants.ts
@@ -2,7 +2,7 @@ import { VERSION } from "remotion";
import { z } from "zod";
export const COMPOSITION_FPS = 30;
-export const COMPOSITION_DURATION_IN_FRAMES = 7 * COMPOSITION_FPS;
+export const DURATION_IN_FRAMES = 7 * COMPOSITION_FPS;
export const COMPOSITION_WIDTH = 1920;
export const COMPOSITION_HEIGHT = 1080;
export const COMPOSITION_ID = "LogoAnimation";
diff --git a/packages/template-react-router/app/styles/layout.css b/packages/template-react-router/app/styles/layout.css
deleted file mode 100644
index ed2bd0fadb..0000000000
--- a/packages/template-react-router/app/styles/layout.css
+++ /dev/null
@@ -1,10 +0,0 @@
-.container {
- display: flex;
- flex-direction: row;
-}
-
-@media screen and (max-width: 900px) {
- .container {
- flex-direction: column;
- }
-}
diff --git a/packages/template-react-router/package.json b/packages/template-react-router/package.json
index eaac5b1249..0cc5ec3a6d 100644
--- a/packages/template-react-router/package.json
+++ b/packages/template-react-router/package.json
@@ -28,6 +28,9 @@
"react-router": "7.2.0",
"react-router-dom": "7.2.0",
"remotion": "workspace:*",
+ "tailwindcss": "4.0.0",
+ "@tailwindcss/cli": "4.0.0",
+ "@tailwindcss/vite": "4.0.0",
"vite": "^5.4.12",
"vite-tsconfig-paths": "^4.2.1",
"zod": "3.22.3"
diff --git a/packages/template-react-router/vite.config.ts b/packages/template-react-router/vite.config.ts
index f8e45a7368..926f8a0ad8 100644
--- a/packages/template-react-router/vite.config.ts
+++ b/packages/template-react-router/vite.config.ts
@@ -1,14 +1,11 @@
import { defineConfig } from "vite";
+import tailwindcss from "@tailwindcss/vite";
import tsconfigPaths from "vite-tsconfig-paths";
-import { reactRouter } from "@react-router/dev/vite"
-
+import { reactRouter } from "@react-router/dev/vite";
export default defineConfig({
- server:{
- port: 3000
+ server: {
+ port: 3000,
},
- plugins: [
- reactRouter(),
- tsconfigPaths()
-],
-});
\ No newline at end of file
+ plugins: [reactRouter(), tsconfigPaths(), tailwindcss()],
+});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 87693136ec..b02ecf18a4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2764,6 +2764,12 @@ importers:
'@remotion/player':
specifier: workspace:*
version: link:../player
+ '@tailwindcss/cli':
+ specifier: 4.0.0
+ version: 4.0.0
+ '@tailwindcss/vite':
+ specifier: 4.0.0
+ version: 4.0.0([email protected])
isbot:
specifier: 4.1.0
version: 4.1.0
@@ -2782,6 +2788,9 @@ importers:
remotion:
specifier: workspace:*
version: link:../core
+ tailwindcss:
+ specifier: 4.0.0
+ version: 4.0.0
vite:
specifier: ^5.4.12
version: 5.4.14(@types/[email protected])
@@ -11726,7 +11735,6 @@ packages:
cpu: [arm64]
os: [android]
requiresBuild: true
- dev: true
optional: true
@@ -11735,7 +11743,6 @@ packages:
cpu: [arm64]
os: [darwin]
requiresBuild: true
- dev: true
optional: true
@@ -11744,7 +11751,6 @@ packages:
cpu: [x64]
os: [darwin]
requiresBuild: true
- dev: true
optional: true
@@ -11753,7 +11759,6 @@ packages:
cpu: [x64]
os: [freebsd]
requiresBuild: true
- dev: true
optional: true
@@ -11762,7 +11767,6 @@ packages:
cpu: [arm]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11771,7 +11775,6 @@ packages:
cpu: [arm]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11780,7 +11783,6 @@ packages:
cpu: [arm64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11789,7 +11791,6 @@ packages:
cpu: [arm64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11798,7 +11799,6 @@ packages:
cpu: [x64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11807,7 +11807,6 @@ packages:
cpu: [x64]
os: [linux]
requiresBuild: true
- dev: true
optional: true
@@ -11816,7 +11815,6 @@ packages:
cpu: [arm64]
os: [win32]
requiresBuild: true
- dev: true
optional: true
@@ -11825,7 +11823,6 @@ packages:
cpu: [ia32]
os: [win32]
requiresBuild: true
- dev: true
optional: true
@@ -11834,7 +11831,6 @@ packages:
cpu: [x64]
os: [win32]
requiresBuild: true
- dev: true
optional: true
@@ -11860,7 +11856,6 @@ packages:
'@parcel/watcher-win32-arm64': 2.5.0
'@parcel/watcher-win32-ia32': 2.5.0
'@parcel/watcher-win32-x64': 2.5.0
- dev: true
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
@@ -14770,7 +14765,6 @@ packages:
mri: 1.2.0
picocolors: 1.1.1
tailwindcss: 4.0.0
- dev: true
/@tailwindcss/[email protected]:
resolution: {integrity: sha512-tfG2uBvo6j6kDIPmntxwXggCOZAt7SkpAXJ6pTIYirNdk5FBqh/CZZ9BZPpgcl/tNFLs6zc4yghM76sqiELG9g==}
@@ -14904,7 +14898,6 @@ packages:
lightningcss: 1.29.1
tailwindcss: 4.0.0
vite: 5.4.14(@types/[email protected])
- dev: true
/@testing-library/[email protected]:
resolution: {integrity: sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==}
@@ -24346,7 +24339,6 @@ packages:
resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==}
- dev: true
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}