From e5088a296ddf1b4cb0e9f6b28a6842231226d817 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Wed, 20 Apr 2022 11:08:39 +0000 Subject: [PATCH 1/7] Move imports to the end --- packages/mdx/src/mdx-plugin/plugin.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/mdx/src/mdx-plugin/plugin.ts b/packages/mdx/src/mdx-plugin/plugin.ts index 41468d5b..f928f68d 100644 --- a/packages/mdx/src/mdx-plugin/plugin.ts +++ b/packages/mdx/src/mdx-plugin/plugin.ts @@ -33,12 +33,6 @@ export function remarkCodeHike( } }) - addConfig(tree, config) - - if (config.autoImport && !hasCodeHikeImport) { - addImportNode(tree) - } - try { await transformPreviews(tree) await transformScrollycodings(tree, config) @@ -52,6 +46,12 @@ export function remarkCodeHike( console.error("error running remarkCodeHike", e) throw e } + + addConfig(tree, config) + + if (config.autoImport && !hasCodeHikeImport) { + addImportNode(tree) + } } } From 702ec2887b3938b14690e0dc32dac1c41db5b94d Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Wed, 20 Apr 2022 08:12:50 -0300 Subject: [PATCH 2/7] Update bundle_analysis.yml --- .github/workflows/bundle_analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bundle_analysis.yml b/.github/workflows/bundle_analysis.yml index 499830ed..07b81767 100644 --- a/.github/workflows/bundle_analysis.yml +++ b/.github/workflows/bundle_analysis.yml @@ -69,7 +69,7 @@ jobs: uses: dawidd6/action-download-artifact@v2 if: success() && github.event.number with: - workflow: nextjs_bundle_analysis.yml + workflow: bundle_analysis.yml branch: ${{ github.event.pull_request.base.ref }} path: ./examples/bundle-test/.next/analyze/base From 1483cfecc455afca79ebf6f3fe18ccd88385f314 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Wed, 20 Apr 2022 12:00:26 +0000 Subject: [PATCH 3/7] Test bundle analyzer --- examples/bundle-test/package.json | 3 ++- examples/bundle-test/pages/js-page.js | 2 +- examples/bundle-test/pages/no-ch-mdx.mdx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/bundle-test/package.json b/examples/bundle-test/package.json index 0a14efa0..2d3ba98c 100644 --- a/examples/bundle-test/package.json +++ b/examples/bundle-test/package.json @@ -16,6 +16,7 @@ "nextBundleAnalysis": { "budget": 358400, "budgetPercentIncreaseRed": 20, - "showDetails": true + "showDetails": true, + "minimumChangeThreshold": 0 } } diff --git a/examples/bundle-test/pages/js-page.js b/examples/bundle-test/pages/js-page.js index 79e8a188..459d27f8 100644 --- a/examples/bundle-test/pages/js-page.js +++ b/examples/bundle-test/pages/js-page.js @@ -2,7 +2,7 @@ export default function Page() { return (

Hello

- Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet. Consectetur adipiscing elit.
) } diff --git a/examples/bundle-test/pages/no-ch-mdx.mdx b/examples/bundle-test/pages/no-ch-mdx.mdx index e93dfc81..953e42b4 100644 --- a/examples/bundle-test/pages/no-ch-mdx.mdx +++ b/examples/bundle-test/pages/no-ch-mdx.mdx @@ -1,3 +1,3 @@ # Hello -Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet. Consectetur adipiscing elit. From 871eadaae38db4b4f26f3a3ad7fad970f0976980 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Wed, 20 Apr 2022 12:27:31 +0000 Subject: [PATCH 4/7] Only import if using code hike --- packages/mdx/src/mdx-plugin/ch-usage.ts | 19 +++++++++++++++++++ packages/mdx/src/mdx-plugin/plugin.ts | 11 ++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 packages/mdx/src/mdx-plugin/ch-usage.ts diff --git a/packages/mdx/src/mdx-plugin/ch-usage.ts b/packages/mdx/src/mdx-plugin/ch-usage.ts new file mode 100644 index 00000000..579214d8 --- /dev/null +++ b/packages/mdx/src/mdx-plugin/ch-usage.ts @@ -0,0 +1,19 @@ +import { JsxNode, SuperNode, visit } from "./nodes" + +export function chUsage(tree: SuperNode) { + const usage = [] + visit( + tree, + ["mdxJsxFlowElement", "mdxJsxTextElement"], + (node: JsxNode) => { + if ( + node.name && + node.name.startsWith("CH.") && + !usage.includes(node.name) + ) { + usage.push(node.name) + } + } + ) + return usage +} diff --git a/packages/mdx/src/mdx-plugin/plugin.ts b/packages/mdx/src/mdx-plugin/plugin.ts index f928f68d..6cab8a56 100644 --- a/packages/mdx/src/mdx-plugin/plugin.ts +++ b/packages/mdx/src/mdx-plugin/plugin.ts @@ -9,6 +9,7 @@ import { CH_CODE_CONFIG_VAR_NAME } from "./unist-utils" import { transformPreviews } from "./preview" import { transformInlineCodes } from "./inline-code" import { EsmNode, SuperNode, visit } from "./nodes" +import { chUsage } from "./ch-usage" type CodeHikeConfig = { theme: any @@ -47,10 +48,14 @@ export function remarkCodeHike( throw e } - addConfig(tree, config) + const usage = chUsage(tree) - if (config.autoImport && !hasCodeHikeImport) { - addImportNode(tree) + if (usage.length > 0) { + addConfig(tree, config) + + if (config.autoImport && !hasCodeHikeImport) { + addImportNode(tree) + } } } } From 128998f64d21f9c99e5c8a1342064a1118b0f968 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Wed, 20 Apr 2022 13:42:10 +0000 Subject: [PATCH 5/7] Add import depending on usage --- packages/mdx/src/components.tsx | 14 ++++ packages/mdx/src/mdx-plugin/plugin.ts | 97 ++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/packages/mdx/src/components.tsx b/packages/mdx/src/components.tsx index 6a554ab2..fa1dbace 100644 --- a/packages/mdx/src/components.tsx +++ b/packages/mdx/src/components.tsx @@ -14,6 +14,20 @@ import { import { Preview } from "./mdx-client/preview" import { InlineCode } from "./mdx-client/inline-code" +export { + Code, + Section, + SectionLink, + SectionCode, + Spotlight, + Scrollycoding, + Preview, + annotationsMap as annotations, + Annotation, + Slideshow, + InlineCode, +} + export const CH = { Code, Section, diff --git a/packages/mdx/src/mdx-plugin/plugin.ts b/packages/mdx/src/mdx-plugin/plugin.ts index 6cab8a56..e5550b3a 100644 --- a/packages/mdx/src/mdx-plugin/plugin.ts +++ b/packages/mdx/src/mdx-plugin/plugin.ts @@ -54,7 +54,7 @@ export function remarkCodeHike( addConfig(tree, config) if (config.autoImport && !hasCodeHikeImport) { - addImportNode(tree) + addSmartImport(tree, usage) } } } @@ -107,6 +107,101 @@ function addConfig( }) } +function addSmartImport(tree: SuperNode, usage: string[]) { + const specifiers = [ + "annotations", + ...usage.map(name => name.slice("CH.".length)), + ] + + tree.children.unshift({ + type: "mdxjsEsm", + value: `export const CH = { ${specifiers.join(", ")} }`, + data: { + estree: { + type: "Program", + body: [ + { + type: "ExportNamedDeclaration", + declaration: { + type: "VariableDeclaration", + declarations: [ + { + type: "VariableDeclarator", + id: { + type: "Identifier", + name: "CH", + }, + init: { + type: "ObjectExpression", + properties: specifiers.map( + specifier => ({ + type: "Property", + method: false, + shorthand: true, + computed: false, + key: { + type: "Identifier", + name: specifier, + }, + kind: "init", + value: { + type: "Identifier", + name: specifier, + }, + }) + ), + }, + }, + ], + kind: "const", + }, + specifiers: [], + source: null, + }, + ], + sourceType: "module", + comments: [], + }, + }, + }) + + tree.children.unshift({ + type: "mdxjsEsm", + value: `import { ${specifiers.join( + ", " + )} } from "@code-hike/mdx/dist/components.cjs.js"`, + data: { + estree: { + type: "Program", + body: [ + { + type: "ImportDeclaration", + + specifiers: specifiers.map(specifier => ({ + type: "ImportSpecifier", + imported: { + type: "Identifier", + name: specifier, + }, + local: { + type: "Identifier", + name: specifier, + }, + })), + source: { + type: "Literal", + value: + "@code-hike/mdx/dist/components.cjs.js", + raw: '"@code-hike/mdx/dist/components.cjs.js"', + }, + }, + ], + sourceType: "module", + }, + }, + }) +} + function addImportNode(tree: SuperNode) { tree.children.unshift({ type: "mdxjsEsm", From c5a6a24190fd1783d230deb4825d5ecd34d248c8 Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Thu, 21 Apr 2022 11:58:26 +0000 Subject: [PATCH 6/7] Bundle client deps --- packages/mdx/package.json | 10 +++--- packages/mdx/rollup.config.js | 11 +++++-- yarn.lock | 59 ++++++++++++++++++++++++++++++++--- 3 files changed, 68 insertions(+), 12 deletions(-) diff --git a/packages/mdx/package.json b/packages/mdx/package.json index 05fadd81..7cdad93b 100644 --- a/packages/mdx/package.json +++ b/packages/mdx/package.json @@ -38,8 +38,6 @@ "coverage": "vitest run --coverage" }, "dependencies": { - "@codesandbox/sandpack-client": "^0.1.20", - "diff": "^4.0.2", "hast-util-to-estree": "^1.4.0", "is-plain-obj": "^3.0.0", "node-fetch": "^2.0.0", @@ -47,12 +45,14 @@ "shiki": "^0.10.1", "unified": "^9.2.2", "unist-util-visit": "^2.0.0", - "unist-util-visit-parents": "^3.0.0", - "use-spring": "^0.2.3" + "unist-util-visit-parents": "^3.0.0" }, "devDependencies": { + "@codesandbox/sandpack-client": "^0.19.0", "@mdx-js/mdx": "^2.0.0", + "@rollup/plugin-commonjs": "^21.1.0", "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^13.2.1", "@rollup/plugin-replace": "^4.0.0", "@types/diff": "^5.0.2", "@types/node": "^17.0.21", @@ -60,6 +60,7 @@ "@types/react": "^17.0.39", "autoprefixer": "^9.8.2", "cssnano": "^4.1.10", + "diff": "^4.0.2", "esbuild": "^0.13.2", "mdx-bundler": "^8.0.1", "mdx-debugger": "^0.2.0", @@ -73,6 +74,7 @@ "rollup-plugin-typescript2": "^0.27.1", "sass": "^1.49.9", "typescript": "^4.6.2", + "use-spring": "^0.2.3", "vite": "^2.8.6", "vitest": "^0.5.9" }, diff --git a/packages/mdx/rollup.config.js b/packages/mdx/rollup.config.js index a1d53b69..c5a58e37 100644 --- a/packages/mdx/rollup.config.js +++ b/packages/mdx/rollup.config.js @@ -8,13 +8,16 @@ import path from "path" import json from "@rollup/plugin-json" import del from "rollup-plugin-delete" import replace from "@rollup/plugin-replace" +import { nodeResolve } from "@rollup/plugin-node-resolve" // import { terser } from "rollup-plugin-terser" +import commonjs from "@rollup/plugin-commonjs" const clientExternal = [ "react", - "@codesandbox/sandpack-client", - "use-spring", - "diff", + "react-dom", + // "@codesandbox/sandpack-client", + // "use-spring", + // "diff", ] const remarkExternal = [ "react", @@ -112,6 +115,8 @@ export default function makeConfig(commandOptions) { ], external: clientExternal, plugins: [ + nodeResolve(), + commonjs(), json({ compact: true }), typescript({ tsconfigOverride: { diff --git a/yarn.lock b/yarn.lock index 85f3d559..d2f985cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1385,10 +1385,10 @@ "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" -"@codesandbox/sandpack-client@^0.1.20": - version "0.1.20" - resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-0.1.20.tgz#4b6c618e223a5ffdc6a82f266e7391fd3a91f15a" - integrity sha512-FlX1AfZwHWJmdeTMZkNdW0YM6sGO+lp9sBwVlxwF4zxq/ki8kGqXJzo326XzjZ5WXQHbWigppjtgyya4BhJy+Q== +"@codesandbox/sandpack-client@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@codesandbox/sandpack-client/-/sandpack-client-0.19.0.tgz#e37bdb06dc2c349d44970b344f66799867229e5f" + integrity sha512-Ar6GIh1MagsEwLAcn4rJqZgjT4WLn2wvfjDISNch+eIzaB2P1u0+4XMIOItVdCN21NIK5TAYsg4t0S0D77IzmA== dependencies: codesandbox-import-utils "^1.2.3" lodash.isequal "^4.5.0" @@ -3029,6 +3029,19 @@ set-cookie-parser "^2.4.8" source-map "^0.7.3" +"@rollup/plugin-commonjs@^21.1.0": + version "21.1.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-21.1.0.tgz#45576d7b47609af2db87f55a6d4b46e44fc3a553" + integrity sha512-6ZtHx3VHIp2ReNNDxHjuUml6ur+WcQ28N1yHgCQwsbNkQg2suhxGMDQGJOn/KuDxKtd1xuZP5xSTwBA4GQ8hbA== + dependencies: + "@rollup/pluginutils" "^3.1.0" + commondir "^1.0.1" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" + "@rollup/plugin-json@^4.1.0": version "4.1.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" @@ -3036,6 +3049,18 @@ dependencies: "@rollup/pluginutils" "^3.0.8" +"@rollup/plugin-node-resolve@^13.2.1": + version "13.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.2.1.tgz#cdee815cf02c180ff0a42536ca67a8f67e299f84" + integrity sha512-btX7kzGvp1JwShQI9V6IM841YKNPYjKCvUbNrQ2EcVYbULtUd/GH6wZ/qdqH13j9pOHBER+EZXNN2L8RSJhVRA== + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.19.0" + "@rollup/plugin-replace@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-4.0.0.tgz#e34c457d6a285f0213359740b43f39d969b38a67" @@ -3574,6 +3599,13 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + "@types/resolve@^1.17.1": version "1.20.1" resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.1.tgz#3727e48042fda81e374f5d5cf2fa92288bf698f8" @@ -4566,6 +4598,11 @@ buffer@^5.2.1: base64-js "^1.3.1" ieee754 "^1.1.13" +builtin-modules@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" + integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== + builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -8916,6 +8953,11 @@ is-lambda@^1.0.1: resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" integrity sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU= +is-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= + is-natural-number@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" @@ -9000,6 +9042,13 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== +is-reference@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== + dependencies: + "@types/estree" "*" + is-reference@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-3.0.0.tgz#b1380c03d96ddf7089709781e3208fceb0c92cd6" @@ -13461,7 +13510,7 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.22.0, resolve@^1.3.2: +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.22.0, resolve@^1.3.2: version "1.22.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== From 509154a9bb2e086f92a484916c1c6f2e0b4c5f1e Mon Sep 17 00:00:00 2001 From: Rodrigo Pombo Date: Thu, 21 Apr 2022 12:05:31 +0000 Subject: [PATCH 7/7] Add scrollytelling to next example --- examples/nextjs/package.json | 1 + examples/nextjs/pages/scrolly.mdx | 154 ++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100644 examples/nextjs/pages/scrolly.mdx diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 5de9157b..ef1e81dc 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -3,6 +3,7 @@ "private": true, "version": "0.0.0", "scripts": { + "dev": "next", "build": "next build" }, "dependencies": { diff --git a/examples/nextjs/pages/scrolly.mdx b/examples/nextjs/pages/scrolly.mdx new file mode 100644 index 00000000..8b85bc81 --- /dev/null +++ b/examples/nextjs/pages/scrolly.mdx @@ -0,0 +1,154 @@ +# Scrollycoding with preview + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. + +Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. + + + +## Step 1 + +Lorem ipsum dolor sit amet, consectetur adipiscing something about points, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. + +> Nova in illis at dabat legi harundine non, ova miratur? _Quid in_ sole aer +> ad diffusa illis voluisti fidensque coniugiale laniata curam. Aras rivus +> eripuit, qua fistula haec partus; serpens, negat. + +Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. + +Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. + +```jsx src/App.js +import { motion } from "framer-motion" + +export default function App() { + const bg = "hsl(20, 100%, 50%)" + return ( + + ) +} +``` + +--- + +## Step 2 + +Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. + +Praesent elementum facilisis leo vel fringilla est ullamcorper eget. + +Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. + +Morbi quis commodo. + +```jsx src/App.js focus=1,4,6:10 +import { motion } from "framer-motion" + +export default function App() { + const bg = "hsl(110, 100%, 50%)" + return ( + + ) +} +``` + +--- + +## Step 3 + +Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. + +- Nisi lacus sed viverra tellus in +- Nibh cras pulvinar mattis nunc sed +- Luctus accumsan tortor posuere ac + +Ut consequat semper viverra. Fringilla ut morbi tincidunt augue interdum velit euismod. + +```jsx src/App.js focus=1,4,6:10 +import { motion } from "framer-motion" + +export default function App() { + const bg = "hsl(200, 100%, 50%)" + return ( + + ) +} +``` + +--- + +## Step 4 + +Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Venenatis cras sed felis eget velit. Consectetur libero id faucibus nisl tincidunt. + +Sed blandit libero volutpat sed cras. + +- Nisi lacus sed viverra tellus in +- Nibh cras pulvinar mattis nunc sed + +Gravida in fermentum et sollicitudin ac orci phasellus egestas tellus. Volutpat consequat mauris nunc congue nisi vitae. + +```jsx src/App.js focus=1,4,6:10 +import { motion } from "framer-motion" + +export default function App() { + const bg = "hsl(290, 100%, 50%)" + return ( + + ) +} +``` + +--- + +## Step 5 + +Velit euismod in pellentesque massa placerat. Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. + +Praesent elementum facilisis leo vel fringilla est ullamcorper eget. + +Id aliquet risus feugiat in ante metus dictum at tempor. Sed blandit libero volutpat sed cras. Sed odio morbi quis commodo odio aenean sed adipiscing. Velit euismod in pellentesque massa placerat. + +Mi bibendum neque egestas congue quisque egestas diam in arcu. Nisi lacus sed viverra tellus in. Nibh cras pulvinar mattis nunc sed. Luctus accumsan tortor posuere ac ut consequat semper viverra. + +- Fringilla ut morbi tincidunt augue interdum velit euismod. +- Luctus accumsan tortor posuere ac ut consequat semper viverra. + +Morbi quis commodo. + +```jsx src/App.js focus=1,4,6:10 +import { motion } from "framer-motion" + +export default function App() { + const bg = "hsl(10, 100%, 50%)" + return ( + + ) +} +``` + + + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies. + +Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilities morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.