Skip to content

Instantly share code, notes, and snippets.

@janispritzkau
Created November 23, 2023 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janispritzkau/8b49a48bde67b059335465299af74bf9 to your computer and use it in GitHub Desktop.
Save janispritzkau/8b49a48bde67b059335465299af74bf9 to your computer and use it in GitHub Desktop.
Tailwind Config with Desaturated Grays using OKLCH
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