feat: support custom primary saturation (#131)

* feat: support custom primary saturation

* chore: run npm run build:css

* docs: update instruction for customizing primary color
This commit is contained in:
Xin
2023-10-04 20:41:59 +01:00
committed by GitHub
parent b7558aca44
commit 8aa6439132
4 changed files with 48 additions and 43 deletions

View File

@ -3,10 +3,10 @@ const colors = require('tailwindcss/colors')
const makePrimaryColor =
l =>
({ opacityValue }) => {
if (opacityValue === undefined) {
return `hsl(var(--primary-hue) 100% ${l}%)`
}
return `hsl(var(--primary-hue) 100% ${l}% / ${opacityValue})`
return (
`hsl(var(--primary-hue) var(--primary-saturation) ${l}%` +
(opacityValue ? ` / ${opacityValue})` : ')')
)
}
/** @type {import('tailwindcss').Config} */