🎥 Make videos programmatically with React
start tailwind-docs
Jonny Burger668f6c19e26f
diff --git a/packages/docs/docs/overwriting-webpack-config.md b/packages/docs/docs/overwriting-webpack-config.mdindex e6e1f57a87..414bad62c8 100644--- a/packages/docs/docs/overwriting-webpack-config.md+++ b/packages/docs/docs/overwriting-webpack-config.md@@ -88,113 +88,8 @@ Create a file which contains `declare module '*.mdx';` in your project to fix a### Enable TailwindCSS support-:::info-This documentation concerns TailwindCSS v2. [Help us update it to v3!](https://github.com/remotion-dev/remotion/issues/737)-:::--1. Install the following dependencies:--<Tabs-defaultValue="npm"-values={[-{ label: 'npm', value: 'npm', },-{ label: 'yarn', value: 'yarn', },-{ label: 'pnpm', value: 'pnpm', },-]-}>-<TabItem value="npm">--```bash-npm i postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer-```-- </TabItem>-- <TabItem value="yarn">--```bash-yarn add postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer-```-- </TabItem>- <TabItem value="pnpm">--```bash-pnpm i postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer-```-- </TabItem>-</Tabs>--2. Add the following to your [`remotion.config.ts`](/docs/config) file:--```ts twoslash-import { Config } from "remotion";-// ---cut----Config.Bundling.overrideWebpackConfig((currentConfiguration) => {- return {- ...currentConfiguration,- module: {- ...currentConfiguration.module,- rules: [- ...(currentConfiguration.module?.rules- ? currentConfiguration.module.rules- : []- ).filter((rule) => {- if (rule === "...") {- return false;- }- if (rule.test?.toString().includes(".css")) {- return false;- }- return true;- }),- {- test: /\.css$/i,- use: [- "style-loader",- "css-loader",- {- loader: "postcss-loader",- options: {- postcssOptions: {- plugins: [- "postcss-preset-env",- "tailwindcss",- "autoprefixer",- ],- },- },- },- ],- },- ],- },- };-});-```--3. Create a file `src/style.css` with the following content:--```css-@tailwind base;-@tailwind components;-@tailwind utilities;-```--4. Import the stylesheet in your `src/Video.tsx` file. Add to the top of the file:--```js-import "./style.css";-```--5. Start using TailwindCSS! You can verify that it's working by adding `className="bg-red-900"` to any element.--6. _Optional_: Add a `tailwind.config.js` file to the root of your project. Add `/* eslint-env node */` to the top of the file to get rid of an ESLint rule complaining that `module` is not defined.--:::warning-Due to a caching bug, the config file might not be picked up until you remove the `node_modules/.cache` folder - watch this issue: https://github.com/remotion-dev/remotion/issues/315-:::+- [TailwindCSS V3](/docs/tailwind)+- [TailwindCSS V2 (Legacy)](/docs/tailwind-legacy)### Enable SASS/SCSS supportdiff --git a/packages/docs/docs/tailwind-2.md b/packages/docs/docs/tailwind-2.mdnew file mode 100644index 0000000000..9a209000ab--- /dev/null+++ b/packages/docs/docs/tailwind-2.md@@ -0,0 +1,112 @@+---+id: tailwind-legacy+title: TailwindCSS v2 (Legacy)+---++:::info+This documentation concerns TailwindCSS v2. [See here for V3!](/docs/tailwind)+:::++1. Install the following dependencies:++<Tabs+defaultValue="npm"+values={[+{ label: 'npm', value: 'npm', },+{ label: 'yarn', value: 'yarn', },+{ label: 'pnpm', value: 'pnpm', },+]+}>+<TabItem value="npm">++```bash+npm i postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer+```++ </TabItem>++ <TabItem value="yarn">++```bash+yarn add postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer+```++ </TabItem>+ <TabItem value="pnpm">++```bash+pnpm i postcss-loader postcss postcss-preset-env tailwindcss@2 autoprefixer+```++ </TabItem>+</Tabs>++2. Add the following to your [`remotion.config.ts`](/docs/config) file:++```ts twoslash+import { Config } from "remotion";+// ---cut---+Config.Bundling.overrideWebpackConfig((currentConfiguration) => {+ return {+ ...currentConfiguration,+ module: {+ ...currentConfiguration.module,+ rules: [+ ...(currentConfiguration.module?.rules+ ? currentConfiguration.module.rules+ : []+ ).filter((rule) => {+ if (rule === "...") {+ return false;+ }+ if (rule.test?.toString().includes(".css")) {+ return false;+ }+ return true;+ }),+ {+ test: /\.css$/i,+ use: [+ "style-loader",+ "css-loader",+ {+ loader: "postcss-loader",+ options: {+ postcssOptions: {+ plugins: [+ "postcss-preset-env",+ "tailwindcss",+ "autoprefixer",+ ],+ },+ },+ },+ ],+ },+ ],+ },+ };+});+```++3. Create a file `src/style.css` with the following content:++```css+@tailwind base;+@tailwind components;+@tailwind utilities;+```++4. Import the stylesheet in your `src/Video.tsx` file. Add to the top of the file:++```js+import "./style.css";+```++5. Start using TailwindCSS! You can verify that it's working by adding `className="bg-red-900"` to any element.++6. _Optional_: Add a `tailwind.config.js` file to the root of your project. Add `/* eslint-env node */` to the top of the file to get rid of an ESLint rule complaining that `module` is not defined.++:::warning+Due to a caching bug, the config file might not be picked up until you remove the `node_modules/.cache` folder - watch this issue: https://github.com/remotion-dev/remotion/issues/315+:::diff --git a/packages/docs/docs/tailwind.md b/packages/docs/docs/tailwind.mdnew file mode 100644index 0000000000..4bb18ef807--- /dev/null+++ b/packages/docs/docs/tailwind.md@@ -0,0 +1,114 @@+---+id: tailwind+title: TailwindCSS+---++import Tabs from "@theme/Tabs";++1. Install the following dependencies:++<Tabs+defaultValue="npm"+values={[+{ label: 'npm', value: 'npm', },+{ label: 'yarn', value: 'yarn', },+{ label: 'pnpm', value: 'pnpm', },+]+}>+<TabItem value="npm">++```bash+npm i postcss-loader postcss postcss-preset-env tailwindcss autoprefixer+```++ </TabItem>++ <TabItem value="yarn">++```bash+yarn add postcss-loader postcss postcss-preset-env tailwindcss autoprefixer+```++ </TabItem>+ <TabItem value="pnpm">++```bash+pnpm i postcss-loader postcss postcss-preset-env tailwindcss autoprefixer+```++ </TabItem>+</Tabs>++2. Add the following to your [`remotion.config.ts`](/docs/config) file:++```ts twoslash+import { Config } from "remotion";+// ---cut---+Config.Bundling.overrideWebpackConfig((currentConfiguration) => {+ return {+ ...currentConfiguration,+ module: {+ ...currentConfiguration.module,+ rules: [+ ...(currentConfiguration.module?.rules+ ? currentConfiguration.module.rules+ : []+ ).filter((rule) => {+ if (rule === "...") {+ return false;+ }+ if (rule.test?.toString().includes(".css")) {+ return false;+ }+ return true;+ }),+ {+ test: /\.css$/i,+ use: [+ "style-loader",+ "css-loader",+ {+ loader: "postcss-loader",+ options: {+ postcssOptions: {+ plugins: [+ "postcss-preset-env",+ "tailwindcss",+ "autoprefixer",+ ],+ },+ },+ },+ ],+ },+ ],+ },+ };+});+```++3. Create a file `src/style.css` with the following content:++```css+@tailwind base;+@tailwind components;+@tailwind utilities;+```++4. Import the stylesheet in your `src/Video.tsx` file. Add to the top of the file:++```js+import "./style.css";+```++5. Start using TailwindCSS! You can verify that it's working by adding `className="bg-red-900"` to any element.++6. _Optional_: Add a `tailwind.config.js` file to the root of your project. Add `/* eslint-env node */` to the top of the file to get rid of an ESLint rule complaining that `module` is not defined.++:::warning+Due to a caching bug, the config file might not be picked up until you remove the `node_modules/.cache` folder - watch this issue: https://github.com/remotion-dev/remotion/issues/315+:::++## See also++- [TailwindCSS v2 (legacy)](/docs/tailwind-legacy)diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex dd701eb755..6d2ec23e8c 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -101,6 +101,7 @@ module.exports = {"dynamic-metadata","ssr","webpack",+ "tailwind","legacy-babel","env-variables","third-party",