Dark Mode Specific Styles in CSS


Use @media (prefers-color-scheme: dark) to apply styles for users who prefer dark mode.

Source Code

@media (prefers-color-scheme: dark) {
    body {
        background-color: #333;
        color: #ccc;
    }
}
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments