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

Theme toggle #478

Open
argyleink opened this issue Nov 23, 2020 · 4 comments
Open

Theme toggle #478

argyleink opened this issue Nov 23, 2020 · 4 comments
Labels
🚀 deeper integration chrome/firefox protocol usage 🔥 enhancement New feature or request good first issue 👍 Good for newcomers
Projects

Comments

@argyleink
Copy link
Collaborator

Instead of only relying on the system preference, it'd be nice to offer an extension preference for theme. Use same logic as color syntax, but allow dark/light/auto.

@argyleink argyleink added 🔥 enhancement New feature or request good first issue 👍 Good for newcomers 🚀 deeper integration chrome/firefox protocol usage labels Nov 23, 2020
@zeaccs
Copy link
Contributor

zeaccs commented May 19, 2021

Would like to help with this issue too, but it seems it's not possible to overwrite the prefers-color-scheme value by using javascript. 🤔

@argyleink
Copy link
Collaborator Author

Would like to help with this issue too, but it seems it's not possible to overwrite the prefers-color-scheme value by using javascript. 🤔

hi @zeaccs! thanks for expressing interest in contributing 🎉

here's a summary of what needs to happen to get this feature:

  1. get the options into the extension dropdown by following what colormode did
  2. update the CSS, which is currently what "auto" should do, so that it can be overwritten
  3. setup the visbug web component to accept color-scheme="light" attribute which will override auto
  4. at this point, you should be able to test the solution by loading the test page at localhost:3000 and then toggling light/dark as the color-scheme attribute
  5. tie up visbug's on load logic (extension and web component lifecycle) to check this value and sync it up
  6. build the extension locally (DevBug) and test using the context menu in the installed DevBug extension.
  7. if visbug's attribute can be set on load on the element or the users choice from the extension context menu, than this is good to go!

it looks like a lot, but i think following what colormode has done will get your 90% of the way. there's a paved path you can piggy back on, since there's a few angles to synchronize and orchestrate.

let me know if you want to chat about this in slack or gitter, i can provide more help as/if you get blocked 👍🏻

@zeaccs
Copy link
Contributor

zeaccs commented May 20, 2021

@argyleink Yes, slack please.

@argyleink
Copy link
Collaborator Author

VisBug on Slack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 deeper integration chrome/firefox protocol usage 🔥 enhancement New feature or request good first issue 👍 Good for newcomers
Projects
v1
  
Awaiting triage
Development

No branches or pull requests

2 participants