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

Web Preferences API #117

Closed
lukewarlow opened this issue Aug 30, 2023 · 9 comments
Closed

Web Preferences API #117

lukewarlow opened this issue Aug 30, 2023 · 9 comments

Comments

@lukewarlow
Copy link

lukewarlow commented Aug 30, 2023

Web Preferences API

Introduction

The Web Preferences API aims to provide a way for sites to indicate a user preference for a given pre-defined setting (e.g. color-scheme preference) in a way that fully integrates with existing Web APIs.

Read the complete Explainer.

Feedback (Choose One)

I welcome feedback in this thread, but encourage you to file bugs against the Explainer.

@lukewarlow lukewarlow changed the title Web Preference API Web Preferences API Aug 31, 2023
@lukewarlow
Copy link
Author

I've made a very rough draft of a spec: https://specs.lukewarlow.dev/web-preferences-api/

@lukewarlow
Copy link
Author

lukewarlow commented Sep 5, 2023

Idk if I count as a potential implementor? But I'm in the progress of making a start on a prototype in Chromium. Haven't filed an intent to prototype yet but working on it locally. Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/UNfjkjHAPOM

@yoavweiss
Copy link
Collaborator

yoavweiss commented Sep 6, 2023

Idk if I count as a potential implementor?

If you're implementing, you're an implementor! :)

@lilles
Copy link

lilles commented Sep 6, 2023

I'm generally positive. Unsure if navigator is the right place, and which spec it should live in. Currently looks like all values are MQ-related, but that might change?

Also, I'd have to think through the iframe behavior. The color-scheme behavior for things like iframes and embedded SVGs is somewhat complicated, and I'm unsure off-the-top-of-my-head how that would work with this API. But those details can be fleshed out.

This API would also be useful for devtools, which currently in Chromium-based browsers has a separate protocol for overriding media query values.

@yoavweiss
Copy link
Collaborator

Glad to see there's support for this! If you want to move this to WICG, feel free to transfer the repo to me and I can do the rest.

@bramus
Copy link

bramus commented Sep 6, 2023

I’m personally very supportive of this proposal as it would allow authors to more easily implement Dark Mode Toggle Buttons without needing to duplicate parts of their CSS nor resort to blocking JS – a problem I’ve written about before, at https://www.bram.us/2022/05/25/dark-mode-toggles-should-be-a-browser-feature/

Very excited.

@lukewarlow
Copy link
Author

@yoavweiss I've just requested a transfer to you :)

@lukewarlow
Copy link
Author

But those details can be fleshed out.

Yeah absolutely there's a few specifics I'm unsure of atm sub-resources is definitely one of them.

This API would also be useful for devtools, which currently in Chromium-based browsers has a separate protocol for overriding media query values.

In my very rough prototype I decided to keep it so dev tools' override is separate to this site preference but again that's something we can nail down in time.

Thanks for taking a look everyone!

@yoavweiss
Copy link
Collaborator

The repo now lives at https://github.com/WICG/web-preferences-api

Happy incubating!!

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

No branches or pull requests

4 participants