Skip to content

🎥 Make videos programmatically with React

contributing

JonnyBurgerec4449351dbe
diff --git a/packages/docs/docs/client-side-rendering/how-it-works.mdx b/packages/docs/docs/client-side-rendering/how-it-works.mdx
index e23861928f..73142fd51c 100644
--- a/packages/docs/docs/client-side-rendering/how-it-works.mdx
+++ b/packages/docs/docs/client-side-rendering/how-it-works.mdx
@@ -79,6 +79,10 @@ Renders happen in the same browser environment as your app. This means CSS and T
See [Limitations](/docs/client-side-rendering/limitations) for more details to ensure your code works with client-side rendering.
+## Contributing
+
+If you are interested in improving the web renderer, for example by adding new styles, see [Contributing to client-side rendering](/docs/contributing/web-renderer).
+
## See also
- [Client-side rendering](/docs/client-side-rendering)
diff --git a/packages/docs/docs/contributing/web-renderer.mdx b/packages/docs/docs/contributing/web-renderer.mdx
index b2751a678e..45600218e0 100644
--- a/packages/docs/docs/contributing/web-renderer.mdx
+++ b/packages/docs/docs/contributing/web-renderer.mdx
@@ -50,6 +50,29 @@ bunx vitest --browser firefox
bunx vitest --browser webkit
```
+## Adding support for new styles
+
+To fix a visual bug or add support for a new CSS property, first obtain some markup that does not look correct, then add it to the [`packages/web-renderer/src/test/fixtures`](https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer/src/test/fixtures) folder.
+
+Also add it to [`packages/web-renderer/src/test/Root.tsx`](https://github.com/remotion-dev/remotion/blob/main/packages/web-renderer/src/test/Root.tsx) so it is rendered in the Studio (`bun run studio`) - you can easily compare it to a server-side render or see how the browser renders it.
+
+Then add a new test ([Example: `packages/web-renderer/src/test/transforms.test.tsx`](https://github.com/remotion-dev/remotion/blob/main/packages/web-renderer/src/test/transforms.test.tsx)) that renders the fixture in 3 different browsers and makes a screenshot of it.
+
+When [running](#running-tests) the tests, it will fail the first time. This is because the expected screenshot is not yet available, but it will be generated the first time.
+
+Update the code in [`packages/web-renderer/src/drawing`](https://github.com/remotion-dev/remotion/tree/main/packages/web-renderer/src/drawing) to add a new feature to the web renderer and run the tests again.
+
+Once the screenshots look like they should, delete the screenshots originally created and run the tests again to generate new ones. Commit them and send a PR!
+
+Also update the [/docs/client-side-rendering/limitations.mdx](/docs/client-side-rendering/limitations) documentation to document the support you added.
+
+AI Agents like Claude Code can help you do most of this work. This is an example prompt that adds support for letter spacing and text transform for text:
+
+> in packages/web-renderer/src/test/text.test.tsx, there is tests for drawing text. this is implemented in packages/web-renderer/src/drawing/text/handle-text-node.ts and a fixture is added in packages/web-renderer/src/test/Root.tsx. add support for letter spacing and text transform and add tests!
+
+Remember to review AI-generated code and finetune it.
+Sloppy, unfiltered AI PRs will not be processed by us.
+
## Enabling the Studio Render Button
Enable the experimental client-side rendering flag in your `remotion.config.ts`: