-
Notifications
You must be signed in to change notification settings - Fork 136
feat(ui): Add dark/light theme toggling sitewide #985
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are doing it wrong tailwind have a dark:
prefix to apply style in dark
@@ -0,0 +1,799 @@ | |||
/* Override css vars for markdown and code blocks (light and dark). */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow you have spend a lot of time for that. But it's a bad practice to override something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything wrong with overriding CSS vars in this case. In an ideal world I wouldn't do that but seeing as the targets in question are external (and they provide an easy way to update the theme with CSS vars) this was IMHO the best option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if it's external let's contribute to the dep (pr already opened by me for deno doc). You should never override your dep. If you need something from your dep:
- Propose change if it's OSS
- Use an other dep that do the same job
- Write your own implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I just verify and it's already supported by dep
https://github.com/denoland/deno-gfm?tab=readme-ov-file#styling
also on provided screenshot, the contrast ratio is horrible |
I use
I see some room for improvement perhaps but could you be more specific please? |
Your point of view is right. But the project use tailwind. So IMO we should use tailwind approche.
on landing page:
|
I like the way you implemented dark theme, it looks beatiful :D. IMO the contrast ratio its fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest the usage of the @preact-icons/tb
package to keep the icons uniform. All icons
I just read through this PR; I have to mostly agree with @AugustinMauroy. |
This PR adds dark/light theme to the frontend by adding the island:
<ThemeToggle />
and a script in the<head>
tag to avoid FOUC (Flash of Unstyled Content).Closes: #18
General TODO list:
islands/ThemeToggle.tsx
<ThemeToggle />
tocomponents/Header.tsx
<script>
in<head>
to_app.tsx
<ThemeToggle />
pre
andcode
boxes