Created
November 23, 2023 18:04
-
-
Save janispritzkau/8b49a48bde67b059335465299af74bf9 to your computer and use it in GitHub Desktop.
Tailwind Config with Desaturated Grays using OKLCH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { formatHex, oklch } from "culori"; | |
import type { Config } from "tailwindcss"; | |
import { gray } from "tailwindcss/colors"; | |
export default { | |
content: ["index.html", "./src/**/*.{ts,tsx,vue}"], | |
theme: { | |
extend: { | |
colors: { | |
gray: Object.fromEntries( | |
Object.entries(gray).map(([key, value]) => { | |
const { l, c, h, mode } = oklch(value)!; | |
return [key, formatHex({ l, c: c * 0.3, h, mode })]; | |
}) | |
), | |
}, | |
}, | |
}, | |
plugins: [], | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment