#Problem with tailwindcss/forms

45 messages · Page 1 of 1 (latest)

trail vault
#

In my next.js project I use tailwindcss. I used a component from this framework. The problem is that when I display my page, the css is not generated. However I followed the documentation, my tailwing.config file is correct. Do you have a solution?

undone juncoBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

finite pilot
#

Show a preview of
⚜️ tailwind.config
⚜️ your css file

trail vault
#

global.css :

#
@tailwind components;
@tailwind utilities;


:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
  }
}

body {
  color: rgb(var(--foreground-rgb));
  background: linear-gradient(
      to bottom,
      transparent,
      rgb(var(--background-end-rgb))
    )
    rgb(var(--background-start-rgb));
}

#

Could the problem be at the tree level of my project? the pages folder containing the files is at the root of the project and in my config this is different

finite pilot
#

Try renaming first your tailwind.config.ts into a different name like TEST or whatever you want and perform again the tailwind initialization command in a terminal pointing to your projet directory

#

Also check you have well import globals.css

hybrid arch
edgy zephyr
#

can you make a "minimal" repo that isn't private please_cat

trail vault
#

otherwise give me your git hub nicknames and I will add you temporarily

edgy zephyr
#

personally, we prefer minimal as we don't need your whole code (unnecessary and waistful when you can give simple)

#

also don't need to add me as i am not even part of this convo

trail vault
#

I cloned my repo in public you can watch it

hybrid arch
#

Are you trying to use the pages router?

#

If you want to use the pages router, you need to create pages/_app.tsx and import the css file there as well

#

Also put pages and app at the same level if you want to use both of them at the same time. (pages and app) or (src/pages and src/app)

trail vault
#

we agree that the page folder must be located in the src/app folder

hybrid arch
#

No. src/pages

trail vault
#

I replace app with pages

hybrid arch
#

src/pages not src/app/pages

#

You are doing src/app/pages which doesn’t work

trail vault
#

ok

#

and what is in my pages folder which is in src/app/pages will go directly to src/pages

hybrid arch
#

Yes just move src/app/pages to src/pages

#

Can you access /dashboard now

#

Btw since you seem to not use the app router just remove src/app entirely

trail vault
#

my next project does not want to remove app from my src/app nor rename it

#

remove src/app and replace wirh src/pages

hybrid arch
#

But change src/app/pages to src/pages because you are trying to use the pages router and src/app/pages is not gonna work

trail vault
#

delete or rename app is not possible

hybrid arch
#

I am not telling you to delete or rename app

#

I’m telling you to move the pages directory from inside app/ to outside it

trail vault
#

my pages folder must be outside of src/app

hybrid arch
#

Ok idk then, best of luck