Skip to main content
Deno 2 is finally here 🎉️
Learn more
Extremely Popular
Go to Latest
function autoDarkColor
import { autoDarkColor } from "https://deno.land/x/fresh@1.5.4/plugins/twindv1_deps.ts";

Looks for a matching dark color within a tailwind color palette (50, 100, 200, ..., 800, 900).

defineConfig({
  darkColor: autoDarkColor,
})

Note: Does not work for arbitrary values like [theme(colors.gray.500)] or [theme(colors.gray.500, #ccc)].

Parameters

section: string

within theme to use

key: string

of the light color or an arbitrary value

unnamed 2: Context<any>

to use

Returns

the dark color if found