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

Component variables (i.e. --p-card-background) not defined on load. #6460

Open
jpelfrey1021 opened this issue Jul 12, 2024 · 0 comments
Open

Comments

@jpelfrey1021
Copy link

I have a vue project built with Vite that has both primevue v4.0.0-beta.5 and tailwind v3.4.4 setup. (also have tailwindcss-primeui v0.3.1 and "primevue/themes v4.0.0-beta.5).

My setup for the theme is below. I have a button component & in the css I am trying to set it's background-color to be var(--p-card-background); I would expect on-load it to show the background color of #FFFFFF, however on-load the inspector says --p-card-background is not defined. Only after I interact with the button does it update to the correct color & show the variable as defined. It seems this is the case even if I do not try to customize the color via the preset.

app.use(PrimeVue, {
theme: {
    preset: definePreset(Lara, {
      semantic: ...,
      components: {
        card: {
          colorScheme: {
            light: {
              root: {
                background: '#FFFFFF'
              }
            },
            dark: {
              root: {
                background: '#141F29'
              }
            }
          }
        },
        ...
    }),
    options: {
      darkModeSelector: '.dark-mode',
      cssLayer: {
        name: 'primevue',
        order: 'tailwind-base, primevue, tailwind-utilities'
      }
    }
  }
});
@atakantepe atakantepe transferred this issue from primefaces/primevue-tailwind Sep 23, 2024
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