Skip to content

Commit

Permalink
Loosen RadiumStyles (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarcuccio authored and nathanmarks committed Oct 10, 2019
1 parent f47ea78 commit 215303b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export type RadiumStyles =
| string
| RadiumCSSObject
| RadiumStylesArray
| React.CSSProperties

export type ElementAttributes<T> = (T extends keyof JSX.IntrinsicElements
? React.ComponentPropsWithoutRef<T>
Expand Down
7 changes: 7 additions & 0 deletions test/typescript/foobar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import * as React from 'react'
import { Button, SVGIcon } from '../../src'

const cssProperties: React.CSSProperties = { display: 'block' }

export function Foo() {
return (
<Button
style={[
{ background: 'green', ':hover': { background: 'purple' } },
true && { color: 'red' },
cssProperties,
{
display: 'block',
'@media (max-width: 123px)': { display: 'inline' },
},
]}
onClick={(e: React.MouseEvent<HTMLButtonElement>) => e}
>
Expand Down

0 comments on commit 215303b

Please sign in to comment.