Skip to content
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

Should persistence be customisable? #3

Open
Kilian opened this issue Aug 31, 2023 · 6 comments
Open

Should persistence be customisable? #3

Kilian opened this issue Aug 31, 2023 · 6 comments

Comments

@Kilian
Copy link

Kilian commented Aug 31, 2023

There are a few ways these settings could be set/saved, and it might make sense for this to be configurable:

Overwrites apply to: page/domain/host
Overwrites apply for the: session/permanently

@lukewarlow
Copy link
Collaborator

lukewarlow commented Aug 31, 2023

My intention is for it to apply for the whole origin and for it to apply permanently. I've updated the explainer to call this out and add the others as a question

@lukewarlow lukewarlow reopened this Sep 6, 2023
@lukewarlow
Copy link
Collaborator

Reopening this to further any discussion that may be needed.

@lukewarlow
Copy link
Collaborator

Some sites update the theme until the next time the system changes. The API as it stands won't support that.

Is this a use case we want to support?

@lukewarlow
Copy link
Collaborator

Wrt my previous comment the new/old requestOverride() function shape is such that an options object could be added that has a way to control the persistence.

Strawman:

navigator.preferences.colorScheme.requestOverride("dark", {persist: false})

@lukewarlow lukewarlow changed the title where do overwritten settings get applied? Should persistence be customisable? Sep 17, 2023
@lukewarlow
Copy link
Collaborator

https://x.com/claviska/status/1771898152792043591?s=20 - provides an example of how you might want different behaviour for different types of site.

@Kilian
Copy link
Author

Kilian commented Mar 25, 2024

A trinary option is what I have on https://colorcontrast.app as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants