Skip to content

Commit 38fd41e

Browse files
wimbareldsRobinMalfait
authored andcommitted
Make content optional for presets in TypeScript types (#11730)
* Update config.d.ts, Make array members partial in Config Instead of `Partial<Array<Thing>>` have `Array<Partial<Thing>>` * simplify types further * update changelog --------- Co-authored-by: Robin Malfait <[email protected]>
1 parent 808c1f0 commit 38fd41e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Improve normalisation of `calc()`-like functions ([#11686](https://github.com/tailwindlabs/tailwindcss/pull/11686))
1717
- Skip `calc()` normalisation in nested `theme()` calls ([#11705](https://github.com/tailwindlabs/tailwindcss/pull/11705))
1818
- Fix incorrectly generated CSS when using square brackets inside arbitrary properties ([#11709](https://github.com/tailwindlabs/tailwindcss/pull/11709))
19+
- Make `content` optional for presets in TypeScript types ([#11730](https://github.com/tailwindlabs/tailwindcss/pull/11730))
1920

2021
## [3.3.3] - 2023-07-13
2122

types/config.d.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ type PrefixConfig = string
4646
type SeparatorConfig = string
4747

4848
// Safelist related config
49-
type SafelistConfig = (string | { pattern: RegExp; variants?: string[] })[]
49+
type SafelistConfig = string | { pattern: RegExp; variants?: string[] }
5050

5151
// Blocklist related config
52-
type BlocklistConfig = string[]
52+
type BlocklistConfig = string
5353

5454
// Presets related config
55-
type PresetsConfig = Config[]
55+
type PresetsConfig = Partial<Config>
5656

5757
// Future related config
5858
type FutureConfigValues =
@@ -352,9 +352,9 @@ interface OptionalConfig {
352352
important: Partial<ImportantConfig>
353353
prefix: Partial<PrefixConfig>
354354
separator: Partial<SeparatorConfig>
355-
safelist: Partial<SafelistConfig>
356-
blocklist: Partial<BlocklistConfig>
357-
presets: Partial<PresetsConfig>
355+
safelist: Array<SafelistConfig>
356+
blocklist: Array<BlocklistConfig>
357+
presets: Array<PresetsConfig>
358358
future: Partial<FutureConfig>
359359
experimental: Partial<ExperimentalConfig>
360360
darkMode: Partial<DarkModeConfig>

0 commit comments

Comments
 (0)