diff --git a/packages/colorwind/src/index.ts b/packages/colorwind/src/index.ts index dcb3df9..0775a54 100644 --- a/packages/colorwind/src/index.ts +++ b/packages/colorwind/src/index.ts @@ -184,19 +184,16 @@ export class Colorwind extends Plugin { } } -function colorwind(): PluginWithoutOptions { - return plugin((api: PluginAPI) => new Colorwind(api, DEFAULT_OPTIONS)); -} - -function colorwind_with(): PluginWithOptions { - return plugin.withOptions((options: ColorwindOptions) => (api: PluginAPI) => { +export const colorwind: PluginWithOptions = + plugin.withOptions((options: ColorwindOptions) => (api: PluginAPI) => { options.colors = options.colors ?? DEFAULT_COLORS; options.utilities = options.utilities ?? DEFAULT_UTILITIES; options.components = options.components ?? DEFAULT_COMPONENTS; new Colorwind(api, options as ColorwindConfig); }); -} -colorwind.with = colorwind_with; +const _colorwind: PluginWithoutOptions = plugin( + (api: PluginAPI) => new Colorwind(api, DEFAULT_OPTIONS), +); -export default colorwind; +export default _colorwind; diff --git a/tailwind.config.ts b/tailwind.config.ts index fb7d6ae..a7218d3 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -1,5 +1,5 @@ import colorwind from 'colorwind'; export default { - plugins: [colorwind()], + plugins: [colorwind], };