Skip to content

Commit

Permalink
Update screens types (#8042)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradlc committed Apr 5, 2022
1 parent b9dec5f commit 6fc8d77
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions types/config.d.ts
Expand Up @@ -71,12 +71,15 @@ type DarkModeConfig =
/** Use the `class` stategy with a custom class instead of `.dark`. */
| ['class', string]

type Screen = { raw: string } | { min: string } | { max: string } | { min: string; max: string }
type ScreensConfig = string[] | KeyValuePair<string, string | Screen | Screen[]>

// Theme related config
interface ThemeConfig {
extend: Partial<Omit<ThemeConfig, 'extend'>>

/** Responsiveness */
screens: ResolvableTo<KeyValuePair>
screens: ResolvableTo<ScreensConfig>

/** Reusable base configs */
colors: ResolvableTo<RecursiveKeyValuePair>
Expand All @@ -85,12 +88,7 @@ interface ThemeConfig {
/** Components */
container: ResolvableTo<
Partial<{
screens:
| string[] /** List of breakpoints. E.g.: '400px', '500px' */
/** Named breakpoints. E.g.: { sm: '400px' } */
| Record<string | number, string>
/** Name breakpoints with explicit min and max values. E.g.: { sm: { min: '300px', max: '400px' } } */
| Record<string, { min: string; max: string }>
screens: ScreensConfig
center: boolean
padding: string | Record<string, string>
}>
Expand Down

0 comments on commit 6fc8d77

Please sign in to comment.