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

Demo page "switch theme" does not work. #84

Closed
kimulaco opened this issue May 29, 2019 · 9 comments
Closed

Demo page "switch theme" does not work. #84

kimulaco opened this issue May 29, 2019 · 9 comments
Labels
bug Something isn't working on hold Temporarily put off, typically until something else is completed

Comments

@kimulaco
Copy link
Contributor

@kognise @kylejrp @jonaskuske
I think using CSS variables is a great idea!!(#70)
However, I found a problem on the demo page, though.

By use "prefers-color-scheme", it does not switch with "switch theme" on the demo page.
This is because the device's theme setting is prioritized.

So, in order to preview both "switch theme" and "prefers-color-scheme" on the demo page, I think it is necessary to take measures such as creating a dedicated demo page.(Page for loading "* .standalone.css".)

I am sorry if it has already been discussed somewhere or the correspondence is in progress.

@kylejrp
Copy link
Collaborator

kylejrp commented May 29, 2019

Hah! Great catch. I don't think there was discussion about this before.

You're right that we'll probably have to use the standalone files to get this working.

@kimulaco
Copy link
Contributor Author

In the future, I think personally it is better to use standalone files in demo page and use "prefers-color-scheme" in landing page.

For now, do change it to read standalone files now?
I can also give a PR.

@kylejrp
Copy link
Collaborator

kylejrp commented May 29, 2019

Yeah, if you can make a pull request that switches to the standalone files, that would be great! Thanks a ton, @kimulaco.

Let's leave this open and discuss more after that merge. I personally like having the "most default" file on all pages where possible. Maybe some feature detection in the JavaScript?

@kimulaco
Copy link
Contributor Author

@kylejrp I will try to adjust the switch by detect "prefers-color-scheme" with "window.matchMedia".
Please wait for a while before give the PR.

@jonaskuske
Copy link
Collaborator

Yes good catch, this needs to be taken care of with the new interactive version picker! (#27)
Then the version used on the demo site should always match the selected one, and there needs to be an explanation for the current display status. ("Light theme is selected, but your system is currently set to dark mode")

I think if we recommend the normal versions as default but always use standalone builds on the demo page, we pretty much "don't practice what we preach" and people will probably be confused why the demo page behaves differently than their own page.

@kimulaco
Copy link
Contributor Author

I will adjusting to read the normal version by default.
Then, when the switching button is pressed, the switching theme is changed based on the loaded theme and the device theme.

I think that showing the status is a good idea!
I will try in this PR.

This was referenced May 29, 2019
@kimulaco
Copy link
Contributor Author

@kylejrp Since you can switch the theme, you can close this issue, but do you wait for the version picker?

@kylejrp
Copy link
Collaborator

kylejrp commented Nov 2, 2019

I'll wait for #90 to automatically close the issue when it gets merged in.

@kylejrp kylejrp added bug Something isn't working on hold Temporarily put off, typically until something else is completed labels Nov 2, 2019
@kognise
Copy link
Owner

kognise commented May 28, 2020

This has been fixed in 2.0.

@kognise kognise closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working on hold Temporarily put off, typically until something else is completed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants