From 2bf8975f4a2709a2eafd1850ce8d1d744d8462d8 Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Thu, 13 Feb 2025 14:51:48 +0100 Subject: [PATCH] Add legacy type exports to `tailwindcss/plugin` export --- CHANGELOG.md | 1 + packages/tailwindcss/src/plugin.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af1c57fdffa3..74b6394a3bcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Don’t replace `_` in suggested theme keys ([#16433](https://github.com/tailwindlabs/tailwindcss/pull/16433)) - Ensure `--default-outline-width` can be used to change the `outline-width` value of the `outline` utility - Ensure drop shadow utilities don't inherit unexpectedly ([#16471](https://github.com/tailwindlabs/tailwindcss/pull/16471)) +- Export backwards compatible config and plugin types from `tailwindcss/plugin` ([#16505](https://github.com/tailwindlabs/tailwindcss/pull/16505)) ## [4.0.6] - 2025-02-10 diff --git a/packages/tailwindcss/src/plugin.ts b/packages/tailwindcss/src/plugin.ts index c6731eb0f55e..fa3dd7a0baf1 100644 --- a/packages/tailwindcss/src/plugin.ts +++ b/packages/tailwindcss/src/plugin.ts @@ -1,4 +1,12 @@ -import type { Config, PluginFn, PluginWithConfig, PluginWithOptions } from './compat/plugin-api' +import type { ThemeConfig } from './compat/config/types' +import type { + Config, + Plugin, + PluginAPI, + PluginFn, + PluginWithConfig, + PluginWithOptions, +} from './compat/plugin-api' function createPlugin(handler: PluginFn, config?: Partial): PluginWithConfig { return { @@ -24,3 +32,6 @@ createPlugin.withOptions = function ( } export default createPlugin + +// v3 compatible types previously exported via `tailwindcss/types/config` +export type { Config, PluginAPI, PluginFn as PluginCreator, Plugin as PluginsConfig, ThemeConfig }