-
I have followed every step on Document to add new color But it doesn't work. Here is my code: pages/_app.js
component/header.js
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @techinp I can' t reproduce it (codesandbox example), but it looks like a mistake in css variable generation. Have you tried restart the dev server? |
Beta Was this translation helpful? Give feedback.
-
Thank you for your example and suggestion. I think I have to find out what is something wrong in my project. |
Beta Was this translation helpful? Give feedback.
-
I found the thing that make my project can't use custom theme if your project use styled-component and set here is my code
|
Beta Was this translation helpful? Give feedback.
-
Since Next.js 12, the swc compiler supports styled-component, you can use this feature instead of babel and works well with NextUI. Configure in /** @type {import('next').NextConfig} */
const nextConfig = {
// others...
compiler: {
styledComponents: true
}
}
module.exports = nextConfig nextjs support docs |
Beta Was this translation helpful? Give feedback.
I found the thing that make my project can't use custom theme
if your project use styled-component and set
ssr: true
in.babelrc
file the new css in custom theme will not workinghere is my code
.babelrc