Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error Unable to parse color from string: var(--color-primary) #4779

Open
ablfaxl opened this issue Feb 1, 2025 · 1 comment
Open

error Unable to parse color from string: var(--color-primary) #4779

ablfaxl opened this issue Feb 1, 2025 · 1 comment

Comments

@ablfaxl
Copy link

ablfaxl commented Feb 1, 2025

I use hero ui in Truborepo and I want to configure theming with CSS variables but I got this error
error Unable to parse color from a string: var(--color-primary)

Do you have any suggestions on how I can fix it?

const baseConfig = require('../../packages/tailwind-config/tailwind.config.js')
const { heroui } = require('@heroui/react')

module.exports = {
  ...baseConfig,
  plugins: [
    ...(baseConfig.plugins || []),
    heroui({
      themes: {
        light: {
          colors: {
            primary: 'var(--color-primary)',
            background: '#ffffff',
            content1: '#e5e5e5'
          }
        },
        dark: {
          colors: {
            primary: '#0800f3',
            background: '#121212',
            content1: '#333333'
          }
        }
      }
    })
  ],
  theme: {
    extend: {
      colors: {
        primary: 'var(--color-primary)',
        background: 'var(--color-background)',
        content1: 'var(--color-content1)'
      }
    }
  },
  content: [...(baseConfig.content || [])]
}
Copy link

linear bot commented Feb 1, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant