diff --git a/types/styled-system/index.d.ts b/types/styled-system/index.d.ts index ca2f7ce1fc..4ba8a04be8 100644 --- a/types/styled-system/index.d.ts +++ b/types/styled-system/index.d.ts @@ -8,6 +8,7 @@ // Matthieu Vachon // Adam Lavin // Joachim Schuler +// Adam Misiorny // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -43,7 +44,7 @@ export interface LowLevelStylefunctionArguments { export function style(args: LowLevelStylefunctionArguments): {[cssProp: string]: string}; export type TLengthStyledSystem = string | 0 | number; -export type ResponsiveValue = T | Array; +export type ResponsiveValue = T | Array | { [key: string]: T }; /** * Converts shorthand margin and padding props to margin and padding CSS declarations diff --git a/types/styled-system/styled-system-tests.tsx b/types/styled-system/styled-system-tests.tsx index 4608aeebec..397e1b0402 100644 --- a/types/styled-system/styled-system-tests.tsx +++ b/types/styled-system/styled-system-tests.tsx @@ -314,12 +314,15 @@ const test = () => ( // responsive width + // responsive font-size + // responsive margin // responsive padding + // examples (margin prop) // sets margin value of `theme.space[2]` // sets margin value of `-1 * theme.space[2]` @@ -332,6 +335,7 @@ const test = () => ( // sets margin `8px` on all viewports and `16px` from the smallest breakpoint and up + // examples // width `50%` // width `256px` @@ -341,6 +345,7 @@ const test = () => ( // width `100%` on all viewports and `50%` from the smallest breakpoint and up + // examples // font-size of `theme.fontSizes[3]` // font-size `32px` @@ -350,6 +355,7 @@ const test = () => ( // font-size `10px` on all viewports and `12px` from the smallest breakpoint and up + // examples // picks the value defined in `theme.colors['blue']` // picks up a nested color value using dot notation // @@ -362,6 +368,7 @@ const test = () => ( // textAlign (responsive) + // lineHeight // fontWeight @@ -371,72 +378,107 @@ const test = () => ( // display (responsive) + // maxWidth (responsive) + // minWidth (responsive) + // height (responsive) + // maxHeight (responsive) + // minHeight (responsive) + // size (responsive, width & height) + // ratio (height: 0 & paddingBottom) // alignItems (responsive) + + // alignContent (responsive) + + // justifyContent (responsive) + + // flexWrap (responsive) + + // flexBasis (responsive) // flexDirection (responsive) + + // gridGap + // gridRowGap + // gridColumnGap + // gridRow + + // gridColumn + + // gridAutoFlow + // gridAutoRows + // gridAutoColumns + // gridTemplateRows + // gridTemplateColumns + // flex (responsive) + + // justifySelf (responsive) + + // alignSelf (responsive) + + @@ -448,10 +490,19 @@ const test = () => ( // position (responsive) + + // zIndex // top, right, bottom, left (responsive) + + // boxShadow // backgroundImage, backgroundSize, backgroundPosition, backgroundRepeat