Skip to content

Commit 56d9c43

Browse files
Make Config completely optional for plugins (#9502)
* Make `Config` completely optional for plugins 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. * Update changelog
1 parent e7b4d33 commit 56d9c43

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4444
- Ignore unset values (like `null` or `undefined`) when resolving the classList for intellisense ([#9385](https://github.com/tailwindlabs/tailwindcss/pull/9385))
4545
- Implement fallback plugins when arbitrary values result in css from multiple plugins ([#9376](https://github.com/tailwindlabs/tailwindcss/pull/9376))
4646
- Improve type checking for formal syntax ([#9349](https://github.com/tailwindlabs/tailwindcss/pull/9349), [#9448](https://github.com/tailwindlabs/tailwindcss/pull/9448))
47+
- Don't require `content` key in custom plugin configs ([#9502](https://github.com/tailwindlabs/tailwindcss/pull/9502))
4748

4849
## [3.1.8] - 2022-08-05
4950

plugin.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import type { Config, PluginCreator } from './types/config'
22
type Plugin = {
33
withOptions<T>(
44
plugin: (options: T) => PluginCreator,
5-
config?: (options: T) => Config
6-
): { (options: T): { handler: PluginCreator; config?: Config }; __isOptionsFunction: true }
7-
(plugin: PluginCreator, config?: Config): { handler: PluginCreator; config?: Config }
5+
config?: (options: T) => Partial<Config>
6+
): { (options: T): { handler: PluginCreator; config?: Partial<Config> }; __isOptionsFunction: true }
7+
(plugin: PluginCreator, config?: Partial<Config>): { handler: PluginCreator; config?: Partial<Config> }
88
}
99

1010
declare const plugin: Plugin

0 commit comments

Comments
 (0)