Is dark mode broken on the Payload-NextJS setup?

default discord avatar
derosul
8 months ago
7

Whenever switching to dark mode, it's a mix between the light theme and dark mode for payload.


Light theme looks perfectly fine...



Oh and good to mention, console doesn't show a thing, no errors loading anything on the network tab either.

  • default discord avatar
    angelok2741
    8 months ago

    Not sure buy maybe we also have to load in the css in withPayload as it accepts a cssConfig aswell

  • discord user avatar
    jarrod_not_jared
    Payload Team
    8 months ago

    Are you loading your own css? Is it overwriting payloads css?

  • default discord avatar
    angelok2741
    8 months ago

    For me both light and dark are not working properly, not loading any custom





    image.png
    image.png
  • discord user avatar
    jarrod_not_jared
    Payload Team
    8 months ago

    Does the demo load properly for you?

    https://demo.payloadcms.com/admin/account
  • default discord avatar
    angelok2741
    8 months ago

    ye it does

  • default discord avatar
    derosul
    8 months ago

    Yup!



    Only css im using is tailwind



    So let me try to disable that.



    Yup! it's tailwind!



    @jarrod_not_jared 🙂



    @angelok2741 you're using Tailwind as well?



    Okay, managed to fix it. I was trying to make the admin page work for the

    pages

    directory instead of the

    app

    directory. The

    pages

    directory always loads the

    _app.tsx

    file and the stylesheets registered in there.



    Apparently you can use both the

    app

    directory and the

    pages

    directory along each other, so moving the payload pages back to the

    app

    directory seems to work just fine 🙂

  • default discord avatar
    angelok2741
    8 months ago

    Ah yes, i am using tailwind aswell. Created a new nextjs with tailwind flag

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.