[@types/rebass] update SxProp definition (#39054)

* [@types/rebass] update SxProp definition

`SxProp` should accept `SystemStyleObject` or `rebass` definition of `sx`

* [rebass] update rebass tests
This commit is contained in:
Ahmad Ilaiwi
2019-10-14 12:03:02 -07:00
committed by Andrew Branch
parent 24e1bf9c9d
commit 155e904680
2 changed files with 9 additions and 2 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
// sara f-p <https://github.com/gretzky>
// angusfretwell <https://github.com/angusfretwell>
// orzarchi <https://github.com/orzarchi>
// ilaiwi <https://github.com/ilaiwi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
@@ -31,7 +32,7 @@ export interface BaseProps extends React.RefAttributes<any> {
* such that properties that are part of the `Theme` will be transformed to
* their corresponding values. Other valid CSS properties are also allowed.
*/
export type SxStyleProp = SystemStyleObject &
export type SxStyleProp = SystemStyleObject |
Record<
string,
| SystemStyleObject
+7 -1
View File
@@ -75,7 +75,13 @@ export default () => (
>
String css prop
</Box>
<Button sx={theme => ({
bg: "magenta",
border: "1em",
borderRadius: "1em"
})}>
Button
</Button>
<CssBox />
</Flex>
</Box>