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

Added dark mode button next to language select #19603

Closed
wants to merge 2 commits into from
Closed

Added dark mode button next to language select #19603

wants to merge 2 commits into from

Conversation

Aelof3
Copy link

@Aelof3 Aelof3 commented Jun 9, 2020

  • Added script to the bottom of index.html to update color scheme
  • Added style element to head via javascript
  • Sends message to iframe viewer to update color scheme on change
  • Added button to inputWrapper via javascript

- Added script to the bottom of index.html to update color scheme
- Added style element to head via javascript
- Sends message to iframe viewer to update color scheme on change
- Added button to inputWrapper via javascript
@Aelof3
Copy link
Author

Aelof3 commented Jun 10, 2020

  • Added style block to head via javascript
  • Added iframe listener to update color scheme when changed in parent

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 10, 2020

@Aelof3
Copy link
Author

Aelof3 commented Jun 10, 2020

Just a heads up the documents loaded in the viewer iframe only accept updates from the threejs.org domain, so it probably will not update the color scheme for whichever document is loaded on that test link

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 13, 2020

Thanks for the PR! However, I think I prefer a simple solution and not allow users to change between light and dark mode with a button.

Besides, design related PRs are somewhat no longer accepted, see #19375 (comment).

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

This seems complicated...

@Aelof3
Copy link
Author

Aelof3 commented Jun 18, 2020

I think the only complicated bit is passing the message to the chosen doc iframe to update the css there as well

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

@Aelof3 What's the use case? You want to force dark mode but your desktop is in light mode?

@Aelof3
Copy link
Author

Aelof3 commented Jun 18, 2020

The issue I was having was that the linux distro I use doesnt specify my preference to the browser, like windows does, so I just came up with a way to have a switch for it. It isnt a big deal, just thought it might be handy for people that dont have their preferences reflected automatically

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

The issue I was having was that the linux distro I use doesnt specify my preference to the browser

The bug is in the distro then 🤓

I think adding a theme selector to the editor makes sense, but I don't think the docs/examples UI should get more complicated because a linux distro lacks a feature...

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

Closing this. Sorry.

@mrdoob mrdoob closed this Jun 18, 2020
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

Successfully merging this pull request may close these issues.

3 participants