mantinedev / next-app-template

Mantine + Next.js app router template (7.0+)
https://mantine.dev/guides/next
MIT License
262 stars 124 forks source link

Connecting theme object with Provider to use custom themes #1

Closed Maetes closed 1 year ago

Maetes commented 1 year ago

I deem it was a mistake or simply forgotton to connect the theme object to the provider.

joey-ma commented 1 year ago

Just looking around to see if and when @mantine Docs is going to fully integrate with Next.js 13's app router. Looks like it's in the works!

Since the user will be defining his/her/their own theme (line 4), I wonder if an empty object will override the default @mantine/core styles? If that is the case, it may be more appropriate to import {theme} from '../theme'; when theme.ts is filled out. Otherwise, your PR (by itself) would make sense. (Although it does not add a feature nor address a bug... 😨❤️🤗😅)

https://github.com/mantinedev/next-app-template/blob/6de8caa666659a5f777095e878f5252d2b16bc9c/theme.ts#L1-L5

Maetes commented 1 year ago

Hey, I think the process to translate each comp0onent from emotion to module css is a though task and consumes an enormous time. So to answer the if is yes but the when is when it's done.

The theme object will not overrider default styles but they are merged in favor for the extended / ammended / overritten styles in the theme object. My intention was that when you are new to mantine and your just want to start it's maybe the first question why it does not reflect the styles you declare in the theme object.... otherwise you can say that, yes before asking read carefully the docs and then go with the template. I think it should work out of the box with the template by not configuring anything at all, that includes a simple and stupid import.