Open mbaljeetsingh opened 1 month ago
Hi
Figured it out after installing the tailwindcss-primeui' and then updating the css variables in
main.css`
tailwind.config.js
module.exports = {
// ...
content: [
"./presets/**/*.{js,vue,ts}",
// other paths
],
plugins: [require('tailwindcss-primeui')]
}
main.css
/* Primary and Surface Palettes */
:root {
--p-primary-50: var(--p-surface-50);
--p-primary-100: var(--p-surface-100);
--p-primary-200: var(--p-surface-200);
--p-primary-300: var(--p-surface-300);
--p-primary-400: var(--p-surface-400);
--p-primary-500: var(--p-surface-500);
--p-primary-600: var(--p-surface-600);
--p-primary-700: var(--p-surface-700);
--p-primary-800: var(--p-surface-800);
--p-primary-900: var(--p-surface-900);
--p-primary-950: var(--p-surface-950);
--p-surface-0: #ffffff;
--p-surface-50: #f8fafc;
--p-surface-100: #f1f5f9;
--p-surface-200: #e2e8f0;
--p-surface-300: #cbd5e1;
--p-surface-400: #94a3b8;
--p-surface-500: #64748b;
--p-surface-600: #475569;
--p-surface-700: #334155;
--p-surface-800: #1e293b;
--p-surface-900: #0f172a;
--p-surface-950: #020617;
--p-content-border-radius: 6px;
}
/* Light Mode */
:root {
--p-primary-color: var(--p-primary-500);
--p-primary-contrast-color: var(--p-surface-0);
--p-primary-hover-color: var(--p-primary-600);
--p-primary-active-color: var(--p-primary-700);
--p-content-border-color: var(--p-surface-200);
--p-content-hover-background: var(--p-surface-100);
--p-content-hover-color: var(--p-surface-800);
--p-highlight-background: var(--p-primary-50);
--p-highlight-color: var(--p-primary-700);
--p-highlight-focus-background: var(--p-primary-100);
--p-highlight-focus-color: var(--p-primary-800);
--p-text-color: var(--p-surface-700);
--p-text-hover-color: var(--p-surface-800);
--p-text-muted-color: var(--p-surface-500);
--p-text-hover-muted-color: var(--p-surface-600);
}
Now, i'm facing issue with setting the dark mode highlight color.
This is my color palette for dark mode
:root[class='dark'] {
--p-primary-50: #f4f7fa;
--p-primary-100: #e5ecf4;
--p-primary-200: #d1ddec;
--p-primary-300: #b1cae0;
--p-primary-400: #8caece;
--p-primary-500: #789ac4;
--p-primary-600: #5d7eb3;
--p-primary-700: #526ca3;
--p-primary-800: #475a86;
--p-primary-900: #3d4c6b;
--p-primary-950: #283043;
...
--p-highlight-background: #8caece33;
...
}
For --p-highlight-background
, I want to use --p-primary-400
with 20% opacity. Do you think it is possible somehow without creating a new variable?
Thanks
I'm trying to convert a large primevue v3 app to primevue v4.
I was following the migration guide after updating the presets. https://primevue.org/guides/migration/v4/
Most of it looks good. But, the theme is not working as expected. You can see the following example after the v4 update
In v3 👇 After v4 👇
In v3 (Dark mode) 👇
After v4 (Dark mode) 👇
Similar issue is present in the tags too.
Following is my theme object inside the
tailwind.config.js
I also saw in the following link to install
tailwindcss-primeui
. I wasn't able to get it working. And is it required. https://tailwind.primevue.org/vite/In that link, I can see the variables are defined differently with
p-
prefix. Let me know if i'm doing something wrong.Thanks, Baljeet