DaisyUI Integration #1477
andre-brandao
started this conversation in
Show and tell
Replies: 2 comments 4 replies
-
I just started playing arround with tailwind 4 + daisyui, to make the transition, just use the following css file ** It might need some ajusts, if you have any that makes it look better please share it here @import 'tailwindcss';
@plugin "daisyui" {
themes: winter --default, dim --prefersdark;
}
/* @plugin "daisyui" {
themes: all;
} */
/* @variant dark (&:where([data-theme=dim], [data-theme=dim] *)); */
@import './tailwindcss-animate.css'
@theme {
--color-border: var(--color-primary);
--color-input: var(--color-secondary);
--color-ring: var(--color-info);
--color-background: var(--color-base-100);
--color-foreground: var(--color-base-content);
--color-primary: var(--color-primary);
--color-primary-foreground: var(--color-primary-content);
--color-secondary: var(--color-secondary);
--color-secondary-foreground: var(--color-secondary-content);
--color-destructive: var(--color-error);
--color-destructive-foreground: var(--color-error-content);
--color-muted: var(--color-neutral);
--color-muted-foreground: var(--color-neutral-content);
--color-accent: var(--color-accent);
--color-accent-foreground: var(--color-accent-content);
--color-popover: var(--color-base-200);
--color-popover-foreground: var(--color-base-content);
--color-card: var(--color-neutral);
--color-card-foreground: var(--color-neutral-content);
--color-sidebar: var(--color-base-200);
--color-sidebar-foreground: var(--color-base-content);
--color-sidebar-primary: var(--color-primary);
--color-sidebar-primary-foreground: var(--color-primary-content);
--color-sidebar-accent: var(--color-primary);
--color-sidebar-accent-foreground: var(--color-primary-content);
--color-sidebar-border: var(--color-base-content);
--color-sidebar-ring: var(--color-base-content);
--radius-xl: calc(var(--rounded-btn) + 4px);
--radius-lg: var(--rounded-btn);
--radius-md: calc(var(--rounded-btn) - 2px);
--radius-sm: calc(var(--rounded-btn) - 4px);
--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;
--animate-caret-blink: caret-blink 1.25s ease-out infinite;
@keyframes accordion-down {
from {
height: 0;
}
to {
height: var(--bits-accordion-content-height);
}
}
@keyframes accordion-up {
from {
height: var(--bits-accordion-content-height);
}
to {
height: 0;
}
}
@keyframes caret-blink {
0%,
70%,
100% {
opacity: 1;
}
20%,
50% {
opacity: 0;
}
}
}
@utility container {
margin-inline: auto;
padding-inline: 2rem;
}
/*
The default border color has changed to `currentColor` in Tailwind CSS v4,
so we've added these compatibility styles to make sure everything still
looks the same as it did with Tailwind CSS v3.
If we ever want to remove these styles, we need to add an explicit border
color utility to any element that depends on these defaults.
*/
@layer base {
*,
::after,
::before,
::backdrop,
::file-selector-button {
border-color: var(--color-gray-200, currentColor);
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
I see you went with |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To use Shadcn components with daisy ui you just need to change the variables in the tailwind config to match daisyui ones, note that daisy ui uses oklch
You should be able to delete the entire postcss file and just change the variables in your tailwind config
Usefull Links
Theme Default Variables
Color Variables
Official Docs
Check the Demo
Demo Repo
Example
Beta Was this translation helpful? Give feedback.
All reactions