diff --git a/types/rebass/index.d.ts b/types/rebass/index.d.ts index 7682bbc68c..72097382cb 100644 --- a/types/rebass/index.d.ts +++ b/types/rebass/index.d.ts @@ -18,7 +18,10 @@ type Omit = Pick>; export interface BaseProps extends React.Props { as?: React.ReactType; - css?: StyledComponents.CSSObject; + css?: + | StyledComponents.CSSObject + | StyledComponents.FlattenSimpleInterpolation + | string; } interface BoxKnownProps diff --git a/types/rebass/rebass-tests.tsx b/types/rebass/rebass-tests.tsx index 87df64f323..4621f20fdb 100644 --- a/types/rebass/rebass-tests.tsx +++ b/types/rebass/rebass-tests.tsx @@ -1,6 +1,7 @@ import * as React from "react"; -import styled from "styled-components"; +import styled, { css } from "styled-components"; import { Box, Flex, Text, Heading, Button, Link, Image, Card } from "rebass"; +import "styled-components/macro"; const CustomComponent: React.FunctionComponent = ({ children }) => { return
{children}
; @@ -14,7 +15,14 @@ ExtendedBox.defaultProps = { p: 3 }; -() => ( +const boxCss = css` + background: purple; + color: white; +`; + +const CssBox = () => ; + +export default () => ( @@ -49,6 +57,15 @@ ExtendedBox.defaultProps = { CustomComponent ExtendedBox + + String css prop + + + );