Merge pull request #34035 from autoric/master

Adds support for @rebass/grid/emotion
This commit is contained in:
Benjamin Lichtman
2019-04-02 18:40:57 -07:00
committed by GitHub
4 changed files with 14 additions and 1 deletions

1
types/rebass__grid/emotion.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export * from './index';

View File

@@ -4,6 +4,7 @@
// Victor Orlov <https://github.com/vittorio>
// Louis Hache <https://github.com/lhache>
// Adam Lavin <https://github.com/lavoaster>
// Erin Noe-Payne <https://github.com/autoric>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9

View File

@@ -1,6 +1,7 @@
import * as React from "react";
import { Flex, Box } from "@rebass/grid";
import { css } from "styled-components";
import * as Emotion from "@rebass/grid/emotion";
const Layout = () => (
<Flex m={4}>
@@ -9,3 +10,11 @@ const Layout = () => (
);
const cssTest = <Flex css='background: transparent;'><Box css={css`${{color: 'inherit'}}`}/></Flex>;
const EmotionLayout = () => (
<Emotion.Flex m={4}>
<Emotion.Box px={3} py={2} />
</Emotion.Flex>
);
const emotionCssTest = <Emotion.Flex css='background: transparent;'><Emotion.Box css={css`${{color: 'inherit'}}`}/></Emotion.Flex>;

View File

@@ -14,7 +14,8 @@
"../"
],
"paths": {
"@rebass/grid": ["rebass__grid"]
"@rebass/grid": ["rebass__grid"],
"@rebass/grid/emotion": ["rebass__grid/emotion"]
},
"types": [],
"noEmit": true,
@@ -23,6 +24,7 @@
},
"files": [
"index.d.ts",
"emotion.d.ts",
"rebass__grid-tests.tsx"
]
}