From 14a571a267b0fa8bd2768bfe292123b24f68e59e Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 7 Oct 2022 10:38:43 -0400 Subject: [PATCH 1/2] Make `Config` completely optional for plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right now the `Config` type requires a `content` key. However, for plugins, this should be completely optional. There’s little reason for a plugin to override content. All other keys are already optional by virtue of using `Partial<…>` so we’ll do the same for the `Config` type used by plugins. --- plugin.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.d.ts b/plugin.d.ts index 07e1e20ec582..4750f155a65e 100644 --- a/plugin.d.ts +++ b/plugin.d.ts @@ -2,9 +2,9 @@ import type { Config, PluginCreator } from './types/config' type Plugin = { withOptions( plugin: (options: T) => PluginCreator, - config?: (options: T) => Config - ): { (options: T): { handler: PluginCreator; config?: Config }; __isOptionsFunction: true } - (plugin: PluginCreator, config?: Config): { handler: PluginCreator; config?: Config } + config?: (options: T) => Partial + ): { (options: T): { handler: PluginCreator; config?: Partial }; __isOptionsFunction: true } + (plugin: PluginCreator, config?: Partial): { handler: PluginCreator; config?: Partial } } declare const plugin: Plugin From 2915060d181e2b17f4ace0d4fcc52041a0ab92c2 Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 7 Oct 2022 10:40:52 -0400 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f044c803530e..d8e8491608a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ignore unset values (like `null` or `undefined`) when resolving the classList for intellisense ([#9385](https://github.com/tailwindlabs/tailwindcss/pull/9385)) - Implement fallback plugins when arbitrary values result in css from multiple plugins ([#9376](https://github.com/tailwindlabs/tailwindcss/pull/9376)) - Improve type checking for formal syntax ([#9349](https://github.com/tailwindlabs/tailwindcss/pull/9349), [#9448](https://github.com/tailwindlabs/tailwindcss/pull/9448)) +- Don't require `content` key in custom plugin configs ([#9502](https://github.com/tailwindlabs/tailwindcss/pull/9502)) ## [3.1.8] - 2022-08-05