Next.js Discord

Discord Forum

daisyui does not work for me

Answered
Linuxbots posted this in #help-forum
Open in Discord
// app/page.tsx

export default function Home() {
return (
#Unknown Channel
<button className="btn btn-active">Default</button>
<button className="btn btn-active btn-neutral">Neutral</button>
<button className="btn btn-active btn-primary">Primary</button>
<button className="btn btn-active btn-secondary">Secondary</button>
<button className="btn btn-active btn-accent">Accent</button>
<button className="btn btn-active btn-ghost">Ghost</button>
<button className="btn btn-active btn-link">Link</button>
</>
);
}
// globals.css
&913086567042674719 base;
&913086567042674719 components;
&913086567042674719 utilities;

:root {
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
padding: 1rem;
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}

// tailwind.config.ts

import type { Config } from 'tailwindcss'
import daisyui from 'daisyui'
const config: Config = {
content: [
'./pages//*.{js,ts,jsx,tsx,mdx}',
'./components/
/.{js,ts,jsx,tsx,mdx}',
'./app/**/
.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
'gradient-conic':
'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
},
},
},

plugins: [daisyui],
}
export default config
Answered by B33fb0n3
import your global.css into your page.tsx
View full answer

35 Replies

@Linuxbots // app/page.tsx export default function Home() { return ( <> <button className="btn btn-active">Default</button> <button className="btn btn-active btn-neutral">Neutral</button> <button className="btn btn-active btn-primary">Primary</button> <button className="btn btn-active btn-secondary">Secondary</button> <button className="btn btn-active btn-accent">Accent</button> <button className="btn btn-active btn-ghost">Ghost</button> <button className="btn btn-active btn-link">Link</button> </> ); } // globals.css <@&913086567042674719> base; <@&913086567042674719> components; <@&913086567042674719> utilities; :root { --background: #ffffff; --foreground: #171717; } @media (prefers-color-scheme: dark) { :root { --background: #0a0a0a; --foreground: #ededed; } } body { color: var(--foreground); background: var(--background); font-family: Arial, Helvetica, sans-serif; padding: 1rem; } @layer utilities { .text-balance { text-wrap: balance; } } // tailwind.config.ts import type { Config } from 'tailwindcss' import daisyui from 'daisyui' const config: Config = { content: [ './pages/**/*.{js,ts,jsx,tsx,mdx}', './components/**/*.{js,ts,jsx,tsx,mdx}', './app/**/*.{js,ts,jsx,tsx,mdx}', ], theme: { extend: { backgroundImage: { 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', }, }, }, plugins: [daisyui], } export default config
import your global.css into your page.tsx
Answer
@B33fb0n3 import your global.css into your page.tsx
thanks , i solve it 👍
@Linuxbots thanks , i solve it 👍
was the error the missing import or how did you solved it?
happy to help
i have another problom
why app automaticly send requerst ?
@Linuxbots why app automaticly send requerst ?
cause its how socket.io works
it automatically tries to establish a connection once u initialised socketio on the client
keep in mind u cant use socketio inside nextjs
is this possible cloe this log ?
@Linuxbots is this possible cloe this log ?
currently its not
@gin keep in mind u cant use socketio inside nextjs
i just created this next app , i did not use any socketio in this project ;
no?
thats weird
yes
can u check in the requests tab
is it coming from yout client
@Linuxbots Click to see attachment
reload
page
and look agai
and also watch for logs in your node console
uhm thats another weird issue
how about u reinstall your app
delete your app and reinstall next@latest
dont forget to add tailwind
ok
let me try
unfortunrtly i create new app but the same log
looks fine now