-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Document colors for different frameworks #160
Comments
Skeleton
export default {
theme: {
extend: {
colors: {
'surface-100': 'rgb(var(--theme-color-surface-100) / <alpha-value>)',
'surface-200': 'rgb(var(--theme-color-surface-200) / <alpha-value>)',
'surface-300': 'rgb(var(--theme-color-surface-300) / <alpha-value>)',
'surface-content': 'rgb(var(--theme-color-surface-content) / <alpha-value>)',
}
},
},
};
/* `:root` doesn't work as needs to be a descendant of `:root` where Skeleton defined `--color-*` */
body {
--theme-color-surface-100: var(--color-surface-50);
--theme-color-surface-200: var(--color-surface-100);
--theme-color-surface-300: var(--color-surface-200);
--theme-color-surface-content: var(--theme-font-color-base);
html.dark & {
--theme-color-surface-100: var(--color-surface-700);
--theme-color-surface-200: var(--color-surface-800);
--theme-color-surface-300: var(--color-surface-900);
--theme-color-surface-content: var(--theme-font-color-dark);
}
} |
Hi I'm using daisyui and I added it in my .css
But it seems nothing changes (using the bar chart example), when I set to light theme, colors is black and white, but using dark theme all is still black and white (nothing changes) Is there something I missed ? Thanks |
Hi @x4080 👋, a few thoughts: You need to have at least the following Tailwind colors defined
You can define them without CSS variables (just set to Daisy UI usually sets colors in the OKLCH color space. They also have similar variables as Svelte UX / LayerChart's variables/tokens (they were a big source of inspiration). You should be able to map Something like this should work (but untested, and might need some refinement): export default {
theme: {
extend: {
colors: {
'surface-100': 'oklch(var(--b1) / <alpha-value>)',
'surface-200': 'oklch(var(--b2) / <alpha-value>)',
'surface-300': 'oklch(var(--b3) / <alpha-value>)',
'surface-content': 'oklch(var(--bc) / <alpha-value>)',
}
},
},
}; Let me know if that helps get you going. If you can setup a repo with Daisy UI and LayerChart, I could investigate it further. |
Thanks for quick answer, I'll try it with
|
I've added a shadcn-svelte section as well as example integration project |
Provide examples to specifying Tailwind colors (or mapping to existing theme colors with other frameworks).
Would be nice to provide integration examples for:
shadcn-svelte
tailwind.config.ts
Skeleton
tailwind.config.ts
app.css
(or anywhere to define CSS)Daisy UI
tailwind.config.ts
Tailwind only
tailwind.config.ts
app.css
(or anywhere to define CSS)flowbite
Doesn't appear to use CSS variables (just Tailwind defined colors), which makes integration challenging.
The text was updated successfully, but these errors were encountered: