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

Add selectable editor themes #31

Merged
merged 3 commits into from
Nov 5, 2019
Merged

Add selectable editor themes #31

merged 3 commits into from
Nov 5, 2019

Conversation

keithlayne
Copy link

This adds a new 'Theme' dropdown menu to the playground. Themes include:

  • light (current playground theme)
  • dark
  • dark with high contrast

On load all themes are registered, and them localStorage is checked for
any saved theme, defaulting to 'light'. Updates store the last selected
theme in localStorage.

Related: microsoft/TypeScript-Website#90

This adds a new 'Theme' dropdown menu to the playground. Themes include:

- light (current playground theme)
- dark
- dark with high contrast

On load all themes are registered, and them localStorage is checked for
any saved theme, defaulting to 'light'.  Updates store the last selected
theme in localStorage.

Related: microsoft/TypeScript-Website#90
@keithlayne
Copy link
Author

I added a checkmark as an indicator in the dropdown menu. It doesn't look good IMO. Let me know if I should just get rid of it. I was thinking there was something like that in bootstrap 3, but didn't see it. I guess it could be like a dropdown select if you want.

Also, seems a little janky on load when you're not using the light theme, but that's probably worse for me right now because I have a pretty high-latency connection right now.

Let me know if I should deploy this using gh-pages so you can see it in action without having to check this out.

@keithlayne
Copy link
Author

TODO: Add the 'crockford' theme. That's black on white with no syntax highlighting, because syntax highlighting is for kindergardeners.

🚎

@orta
Copy link
Owner

orta commented Nov 5, 2019

Hah at the Crockford theme, blows my mind that

2019-11-05 09-17-19 2019-11-05 09_19_21

Alright, this is ready to go.

@orta orta marked this pull request as ready for review November 5, 2019 14:20
@orta
Copy link
Owner

orta commented Nov 5, 2019

It doesn't blink on reload when you're in dark too now

@keithlayne
Copy link
Author

Yeah so I had to disable format on save and didn't stage those trailing whitespace changes. Whole thing could use a trip through prettier so my editor doesn't try to rewrite all the files.

@orta
Copy link
Owner

orta commented Nov 5, 2019

Yeah, I have to have my formatters disabled because of the examples which need custom formatting

@keithlayne
Copy link
Author

Well, there's already a .prettierignore, so add them to that maybe?

Anyway, thanks for making this happen, you have increased the happiness in the world.

@orta orta merged commit 2e7923e into orta:master Nov 5, 2019
@keithlayne keithlayne deleted the themes branch November 5, 2019 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants