tailwind-colors
/
1.0.0
tailwind-colors 1.0.0
Install from the command line:
Learn more about npm packages
$ npm install @plentymarkets/tailwind-colors@1.0.0
Install via package.json:
"@plentymarkets/tailwind-colors": "1.0.0"
About this version
Package to generate a 10-color palette based on a given color hex. Useful to generate Tailwind CSS palettes.
npm install --save palettey
import { createPaletteFromColor } from "palettey";
// Generate a luminance palette
createPaletteFromColor("primary", "#7953e0", {
useLightness: false,
})
// Generate a lightness palette
createPaletteFromColor("primary", "#7953e0", {})
To create css variables for the generated palette you can use:
const palette = createPaletteFromColor("primary", "D20000", {});
Object.entries(palette.test).forEach((entry) => {
const [step, color] = entry;
document.documentElement.style.setProperty(
`--color-primary-${step}`,
color
);
});
Check out Palette Generator to try the generator online.
Based on tailwind-css-palette-generator created by Simeon Griggs Contribution by George Ciesinski
Details
- tailwind-colors
- plentymarkets
- 3 months ago
- MIT
- 2 dependencies
Assets
- tailwind-colors-1.0.0.tgz
Download activity
- Total downloads 219
- Last 30 days 84
- Last week 36
- Today 0