Skip to content

Commit 0f0d060

Browse files
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 <malfait.robin@gmail.com>
1 parent a93c61f commit 0f0d060

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

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

3031
### Added
3132

types/config.d.ts

Lines changed: 6 additions & 6 deletions
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 =
@@ -353,9 +353,9 @@ interface OptionalConfig {
353353
important: Partial<ImportantConfig>
354354
prefix: Partial<PrefixConfig>
355355
separator: Partial<SeparatorConfig>
356-
safelist: Partial<SafelistConfig>
357-
blocklist: Partial<BlocklistConfig>
358-
presets: Partial<PresetsConfig>
356+
safelist: Array<SafelistConfig>
357+
blocklist: Array<BlocklistConfig>
358+
presets: Array<PresetsConfig>
359359
future: Partial<FutureConfig>
360360
experimental: Partial<ExperimentalConfig>
361361
darkMode: Partial<DarkModeConfig>

0 commit comments

Comments
 (0)