Skip to content

Commit

Permalink
[chore] updates README - styles
Browse files Browse the repository at this point in the history
  • Loading branch information
hdix authored and diasbruno committed Jan 28, 2018
1 parent 0259f05 commit f5b9c11
Showing 1 changed file with 30 additions and 27 deletions.
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,34 +98,37 @@ Example:

## Styles

Styles are passed as an object with 2 keys, 'overlay' and 'content' like so
Styles are passed with the `style` prop, an object with 2 keys, 'overlay' and 'content' like so

```js
{
overlay : {
position : 'fixed',
top : 0,
left : 0,
right : 0,
bottom : 0,
backgroundColor : 'rgba(255, 255, 255, 0.75)'
},
content : {
position : 'absolute',
top : '40px',
left : '40px',
right : '40px',
bottom : '40px',
border : '1px solid #ccc',
background : '#fff',
overflow : 'auto',
WebkitOverflowScrolling : 'touch',
borderRadius : '4px',
outline : 'none',
padding : '20px'

}
}
```jsx
<Modal
...
style={{
overlay: {
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundColor: 'rgba(255, 255, 255, 0.75)'
},
content: {
position: 'absolute',
top: '40px',
left: '40px',
right: '40px',
bottom: '40px',
border: '1px solid #ccc',
background: '#fff',
overflow: 'auto',
WebkitOverflowScrolling: 'touch',
borderRadius: '4px',
outline: 'none',
padding: '20px'
}
}}
...
>
```

Styles passed to the modal are merged in with the above defaults and applied to their respective elements.
Expand Down

0 comments on commit f5b9c11

Please sign in to comment.