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

Darkmode #40

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Darkmode #40

wants to merge 18 commits into from

Conversation

GottaGetPaid
Copy link
Collaborator

@GottaGetPaid GottaGetPaid commented Feb 8, 2025

Screenshot 2025-02-08 at 3 35 07 AM

@GottaGetPaid GottaGetPaid self-assigned this Feb 10, 2025
@Hal-9k1
Copy link
Collaborator

Hal-9k1 commented Feb 27, 2025

I think you could also do this without passing the dark mode setting all through the code by adding another class to the App div element and then adding all the dark mode rules with the descendant selector. Pseudocode:

function App() {
    // ...
    return <div className={useDarkmode ? "darkmode" : ""}>
        {/* ... */}
    </div>;
}
.SomeComponent {
    background-color: white:
    /* other light mode rules */
}
.darkmode .SomeComponent {
    background-color: black;
}

This would give different specificity to the dark and light mode selectors though.

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