npm.io
1.0.0 • Published 23h agoCLI

daisypicker

Licence
MIT
Version
1.0.0
Deps
0
Size
60 kB
Vulns
0
Weekly
0

daisypicker

Composable design-token palette engine for building role-based color systems and exporting them to CSS variables, Tailwind, or DaisyUI themes.

Install

npm install daisypicker

Quick start

const daisypicker = require("daisypicker");

const picker = daisypicker({ preset: "spring" });

picker.pickRole("primary", "#4f46e5");
const tokens = picker.resolve();
const css = picker.export("css");
const tw = picker.export("tailwind");
const daisy = picker.export("daisyui");

Architecture

Garden  →  Bloom(s)  →  Petal(s)
   └── Stem graph (inheritance links)

Pickers → Engines → Pipeline (normalize → validate → resolve) → Adapters
Layer Responsibility
core/ Petal, Bloom, Stem, Garden domain models
pickers/ Hue / shade / role / random selection APIs
engines/ Shade scales, harmony, contrast, naming
pipeline/ Normalize, validate, resolve, compose
adapters/ CSS / Tailwind / DaisyUI / JSON exporters
presets/ Built-in themes: spring, dusk, meadow
cache/ In-memory + file caches
integrations/pickmodule/ Embedded pickmodule (vendor + bridges + theming + runtime + plugin)

Embedded pickmodule (offline / PWA)

Original pickmodule modules live under src/integrations/pickmodule/vendor/. Requiring daisypicker loads and runs pickmodule automatically. The same export also works as a Tailwind plugin (no separate dp.js entry).

// Drop-in — pickmodule runs on require; Tailwind uses the same export
module.exports = {
  plugins: [require("daisypicker")],
};

// Palette factory still works when called with options
const picker = require("daisypicker")({ preset: "dusk" });
module.exports = {
  plugins: [picker.offline().asTailwindPlugin()],
};
<div class="sw-update-prompt">
  A new version is available.
  <button type="button" class="sw-update-prompt__btn">Reload</button>
</div>

CLI

npx daisypicker presets
npx daisypicker pick --preset dusk --format css --out theme.css
npx daisypicker pick --preset meadow --format daisyui

Presets

  • spring — fresh greens
  • dusk — violet / dark base
  • meadow — teal calm

Versioning

This package is designed to grow by version upgrades. Keep existing APIs stable; add features in minor/patch releases.

See upgrade.md for the planned feature checklist (1.1.02.0.0).

Keywords