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

docs: SvelteKit Example Issue with tailwind.config.cjs #3207

Closed
mkmoisen opened this issue Sep 12, 2024 · 1 comment
Closed

docs: SvelteKit Example Issue with tailwind.config.cjs #3207

mkmoisen opened this issue Sep 12, 2024 · 1 comment

Comments

@mkmoisen
Copy link

On which page do you see this issue?

https://stackblitz.com/edit/daisyui-sveltekit?file=tailwind.config.cjs

Describe the issue

The SvelteKit example uses the following tailwind.config.cjs file:

module.exports = {
  content: ['./src/routes/**/*.{svelte,js,ts}'],
  plugins: [require('daisyui')],
};

I believe this should be changed to:

module.exports = {
  content: ['./src/**/*.{svelte,js,ts}'],
  plugins: [require('daisyui')],
};

It is common in svelte to have a directory structure like:

/src/
    /lib/
        /components
    /routes/
        +page.svelte

Where components are placed outside of /src/routes/.

If you mindlessly follow the example like I do, the DaisyUI CSS will not work when you run npm run build.

Interestingly, it seems to work pretty much OK when you run npm run dev, although it is kind of hit or miss. Sometimes the styles get applied, and other times they do not.

Replacing with ['./src/**/*.{svelte,js,ts}'], fixes both of these issues.

What browsers are you seeing the problem on?

All browsers

Copy link

Thank you @mkmoisen for reporting issues. It helps daisyUI a lot 💚
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.

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

2 participants