Night proof
Check both the paper tone and the ink contrast.
Reference / Variants & accessibility
Use dark: to provide an alternate palette. The default mode follows the user’s system color-scheme preference.
Check both the paper tone and the ink contrast.
Set darkMode to "class" in the configuration if your app owns the theme switch. In that mode a dark class on the component or an ancestor activates the variants.
<article class="rounded border border-neutral-300 bg-white p-4 text-black dark:border-neutral-600 dark:bg-neutral-900 dark:text-white">
<h3 class="font-bold">Night proof</h3>
<p>Check both the paper tone and the ink contrast.</p>
</article>| Class | CSS declarations |
|---|---|
dark:bg-neutral-900 | background-color: oklch(0.32 0 0); |
dark:text-white | color: #fff; |
dark:border-neutral-600 | border-color: oklch(0.56 0 0); |
dark:hover:bg-neutral-800 | background-color: oklch(0.4 0 0); |
@media (prefers-color-scheme: dark) {
.dark\:border-neutral-600 {
border-color: oklch(0.56 0 0);
}
.dark\:text-white {
color: #fff;
}
.dark\:bg-neutral-900 {
background-color: oklch(0.32 0 0);
}
@media (hover: hover) {
.dark\:hover\:bg-neutral-800:hover {
background-color: oklch(0.4 0 0);
}
}
}