mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.34k stars 1.87k forks source link

Website breaks on switching between dark and light mode #204

Closed dukesx closed 3 years ago

dukesx commented 3 years ago

The issue : Website breaks when i switch between dark and light mode. Doesn't matter, regardless of whether its next-dark-mode or use-dark-mode or through context api, if i switch it, the whole website just breaks, the css, the JavaScript, everything. It just happened suddenly and i don't know what just happened. Check Sandbox link for detailed demo.

Note: the demo is fork of the project under issue. This is based on your Nextjs Starter Kit (Template)

Thanks for reaching out!

Please provide following information:

rtivital commented 3 years ago

Hi @dukesx, thanks for reproduction, try removing { minify: true } both from _app.tsx and _document.tsx

dukesx commented 3 years ago

Hi @dukesx, thanks for reproduction, try removing { minify: true } both from _app.tsx and _document.tsx

Hi Thanks for the prompt reply, was using minify for generating ids a typo ? because after the removal, the issue seems to be gone.

rtivital commented 3 years ago

It was an error in documentation on getting started with next.js, seems like minify option does not work well with next.js – now the issue is fixed both in docs and Next template

dukesx commented 3 years ago

It was an error in documentation on getting started with next.js, seems like minify option does not work well with next.js – now the issue is fixed both in docs and Next template

It is however strange since the ssr docs for react jss don't specifically say that minify won't work but nevertheless, would have been a good option to reduce the name string length. I haven't checked the class name lengths after change but I hope they aren't that long.