diff --git a/package.json b/package.json index 804a7bd1..cb659773 100644 --- a/package.json +++ b/package.json @@ -56,5 +56,5 @@ "workspaces": [ "packages/*" ], - "packageManager": "pnpm@9.6.0+sha512.38dc6fba8dba35b39340b9700112c2fe1e12f10b17134715a4aa98ccf7bb035e76fd981cf0bb384dfa98f8d6af5481c2bef2f4266a24bfa20c34eb7147ce0b5e" + "packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4" } diff --git a/packages/tod-blog/.eslintrc.json b/packages/tod-blog/.eslintrc.json index f289bd59..fe50b5c5 100644 --- a/packages/tod-blog/.eslintrc.json +++ b/packages/tod-blog/.eslintrc.json @@ -15,8 +15,9 @@ "rules": { "import/no-extraneous-dependencies": "error", "import/no-relative-packages": "error", - "import/no-useless-path-segments": "error" + "import/no-useless-path-segments": "error", + "react/no-unknown-property": ["error", { "ignore": ["css"] }] } } ] -} \ No newline at end of file +} diff --git a/packages/tod-blog/app/emotion.tsx b/packages/tod-blog/app/emotion.tsx new file mode 100644 index 00000000..78ce36fe --- /dev/null +++ b/packages/tod-blog/app/emotion.tsx @@ -0,0 +1,116 @@ +'use client'; +import createCache, { + EmotionCache, + Options as OptionsOfCreateCache, +} from '@emotion/cache'; +import { CacheProvider as DefaultCacheProvider } from '@emotion/react'; +import { useServerInsertedHTML } from 'next/navigation'; +import { Fragment, useState } from 'react'; + +export type AppRouterCacheProviderProps = { + /** + * These are the options passed to createCache() from 'import createCache from "@emotion/cache"'. + */ + options?: Partial & { + /** + * If `true`, the generated styles are wrapped within `@layer mui`. + * This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind CSS, plain CSS etc. + */ + enableCssLayer?: boolean; + }; + /** + * By default from 'import { CacheProvider } from "@emotion/react"'. + */ + CacheProvider?: React.ElementType<{ value: EmotionCache }>; + children: React.ReactNode; +}; + +/** + * Emotion works OK without this provider but it's recommended to use this provider to improve performance. + * Without it, Emotion will generate a new