-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Dark mode implementation #167
Conversation
This is a great start. There are a few areas that need to be addressed:
I'm going to go through this PR and highlight these, probably committing. |
This is a pretty big PR touching a lot of files. Let's hold off merging other react component changes until this is reviewed and we're comfortable with it (or deciding some other resolution strategy). |
I also agree that this is a great start. thank you @LucianPetri. I would like to propose a strategy for moving forward with this: Ideally, all dark mode handling should be done either be configuring the theme directly, or by having some conditional styling for the components under Everything under This should make our work future proof, and changes to the design both easy and global. I am not sure if browser support is there yet, or if chakra ui supports it, but Container queries sound really promising for paddings margins and such... |
index.tsx was not intended to be part of previous commit
website/src/pages/index.tsx
Outdated
@@ -21,12 +21,12 @@ const Home = () => { | |||
content="Conversational AI for everyone. An open source project to create a chat enabled GPT LLM run by LAION and contributors around the world." | |||
/> | |||
</Head> | |||
{session ? ( | |||
{false ? ( |
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.
This debugging hack snuck in to my commit. Will be setting it back to session.
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.
This looks pretty close to being ready. What's stopping us from handling the merge conflicts and checking it in as is?
} | ||
} | ||
|
||
export const containerTheme = defineStyleConfig({ |
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'd suggest naming the variable the same as the thing being themed. In this case Container
In the index.ts
we can then do
export { default as Container } from "./Container";
This is how Chakra structures their pro themes.
website/src/styles/Theme/index.ts
Outdated
@@ -0,0 +1,29 @@ | |||
import { type ThemeConfig, extendTheme } from "@chakra-ui/react"; | |||
import { containerTheme } from "./components/Container"; |
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.
Rather than import each components theme here can we create a website/src/styles/Theme/components/index.ts
file.
With that we can simplify this as
import * as components from "./components";
And then down below we don't need to define a const components = { ...}
. We can just use the import
I took a look at this branch. I think we should just check this in as is and then revise the small UI issues in later (tinier) PRs. The key things to fix before approval:
|
…nused 'ColorModeSwitch' component for now.
The UI and implementation issues actually aren't minor. The implementation uses chakra-ui/chakra-ui#6905 On top of that, there are UI regressions in the light theme home page, and header, and the dark theme is broken / not implemented for the grading pages. So the dark theme needs a lot of work. We should have a typical merge policy where merges must:
I have fixes for these things though. I think this should be ready to merge in a few hours (dinnertime now 🍲). Currently working on:
|
…onent, which is for contianing width (and buggy). Last commit before pulling in latest to resolve merge confilicts, and continue to fix the survey pages.
Alright. All checks passing and ready. |
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.
Great to finally get this in.
I'll make some small targeted fixes for things in a follow up PR
Dark Mode Implementation Details Here: #90