UNPKG

@poupe/tailwindcss

Version:

TailwindCSS v4 plugin for Poupe UI framework with theme customization support

32 lines (29 loc) 2.18 kB
export { KebabCase } from 'type-fest'; export { Color, ColorFormat, Hct, colorFormatter, hct, hexString, hslString, rgbaString as rgbString, rgba, splitHct } from '@poupe/theme-builder/core'; export { CSSRuleObject, CSSRules, formatCSSRules, keys, pairs, properties, kebabCase as toKebabCase, unsafeKeys } from '@poupe/css'; import origPlugin, { PluginAPI, Config } from 'tailwindcss/plugin'; export { Config, PluginAPI, PluginCreator as PluginFn } from 'tailwindcss/plugin'; type PluginWithConfig = ReturnType<typeof origPlugin>; type PluginWithOptions<O> = ReturnType<typeof origPlugin.withOptions<O>>; /** * Creates a Tailwind plugin with configurable options. * * @typeParam O - The type of input configuration options (user-provided) * @typeParam T - The type of processed options used by the plugin functions (internal) * @param pluginFunction - Handles the plugin's core logic (addUtilities, etc.) using processed options T. * @param configFunction - Generates partial Tailwind config using processed options T. * @param processOptions - Processes user input O into the internal options T * @returns A plugin function expecting user options O. */ declare function pluginWithOptions<O, T>(pluginFunction: (api: PluginAPI, options: T) => void, configFunction?: (options: T) => Partial<Config>, processOptions?: (options?: O) => T): PluginWithOptions<O>; /** * Creates a Tailwind plugin with partial configuration options. * * @typeParam T - The type of configuration options for the plugin * @param pluginFunction - A function that generates the Tailwind plugin * @param configFunction - A function that generates partial Tailwind configuration based on options * @param defaultsFunction - A function that provides default options with partial configuration * @returns A plugin function with partial configurable options */ declare function pluginWithPartialOptions<T>(pluginFunction: (api: PluginAPI, options: T) => void, configFunction?: (options: T) => Partial<Config>, defaultsFunction?: (options?: Partial<T>) => T): PluginWithOptions<Partial<T>>; export { type PluginWithConfig, type PluginWithOptions, pluginWithOptions, pluginWithPartialOptions };