mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[styled-system] Allow null ResponsiveValue (#42961)
This commit is contained in:
parent
9507f878ee
commit
3692d1c231
2
types/styled-system/index.d.ts
vendored
2
types/styled-system/index.d.ts
vendored
@ -60,7 +60,7 @@ export type RequiredTheme = Required<Theme>;
|
||||
export type ResponsiveValue<
|
||||
T,
|
||||
ThemeType extends Theme = RequiredTheme,
|
||||
> = T | Array<T | null> | { [key in ThemeValue<'breakpoints', ThemeType> & string | number]?: T };
|
||||
> = T | null | Array<T | null> | { [key in ThemeValue<'breakpoints', ThemeType> & string | number]?: T };
|
||||
|
||||
export type ThemeValue<K extends keyof ThemeType, ThemeType, TVal = any> =
|
||||
ThemeType[K] extends TVal[] ? number :
|
||||
|
||||
@ -220,6 +220,7 @@ const test = () => (
|
||||
<Box display={{ sm: 'block', md: 'inline-block' }} />
|
||||
// maxWidth (responsive)
|
||||
<Box maxWidth={1024} />
|
||||
<Box maxWidth={null} />
|
||||
<Box maxWidth={[768, null, null, 1024]} />
|
||||
<Box maxWidth={{ sm: 768, lg: 1024 }} />
|
||||
// minWidth (responsive)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user