Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Change localstorage to cookie or give the ability to change it easily #7317

Closed
1 of 2 tasks
sovetski opened this issue Dec 29, 2024 · 2 comments
Closed
1 of 2 tasks

Comments

@sovetski
Copy link

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.15.2

What package has an issue?

@mantine/core

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

I know that you will close this issue again like others without any help, any way I create it

By default the colorScheme is stored in local storage, why not. But on SSR the server can not read it, but it can read cookies:
image

Related: #7314

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

  • I would be willing to implement a fix for this issue
@niravbhimani53
Copy link

niravbhimani53 commented Jan 1, 2025

Hi @sovetski You can create a custom colour scheme manager according to the docs.

The example in the link shows a custom colour scheme manager implementation with local storage but you can update the implementation with cookies as required.

@sovetski
Copy link
Author

sovetski commented Jan 1, 2025

Hi @sovetski You can create a custom colour scheme manager according to the docs.

The example in the link shows a custom colour scheme manager implementation with local storage but you can update the implementation with cookies as required.

Hi, thank you but I already tried before opening this issue and it did not work. It stored the color scheme value in the cookie, but on SSR, when the value was "auto" there was hydratation error on page load.

If you have a working example of custom colour scheme with SSR and "auto" support, can you share your code?

Thanks

@mantinedev mantinedev locked and limited conversation to collaborators Jan 2, 2025
@rtivital rtivital converted this issue into discussion #7325 Jan 2, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants