Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update screens types #8042

Merged
merged 1 commit into from Apr 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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