Skip to content

Commit f5b9c11

Browse files
hdixdiasbruno
authored andcommitted
[chore] updates README - styles
1 parent 0259f05 commit f5b9c11

File tree

1 file changed

+30
-27
lines changed

1 file changed

+30
-27
lines changed

README.md

+30-27
Original file line numberDiff line numberDiff line change
@@ -98,34 +98,37 @@ Example:
9898

9999
## Styles
100100

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

103-
```js
104-
{
105-
overlay : {
106-
position : 'fixed',
107-
top : 0,
108-
left : 0,
109-
right : 0,
110-
bottom : 0,
111-
backgroundColor : 'rgba(255, 255, 255, 0.75)'
112-
},
113-
content : {
114-
position : 'absolute',
115-
top : '40px',
116-
left : '40px',
117-
right : '40px',
118-
bottom : '40px',
119-
border : '1px solid #ccc',
120-
background : '#fff',
121-
overflow : 'auto',
122-
WebkitOverflowScrolling : 'touch',
123-
borderRadius : '4px',
124-
outline : 'none',
125-
padding : '20px'
126-
127-
}
128-
}
103+
```jsx
104+
<Modal
105+
...
106+
style={{
107+
overlay: {
108+
position: 'fixed',
109+
top: 0,
110+
left: 0,
111+
right: 0,
112+
bottom: 0,
113+
backgroundColor: 'rgba(255, 255, 255, 0.75)'
114+
},
115+
content: {
116+
position: 'absolute',
117+
top: '40px',
118+
left: '40px',
119+
right: '40px',
120+
bottom: '40px',
121+
border: '1px solid #ccc',
122+
background: '#fff',
123+
overflow: 'auto',
124+
WebkitOverflowScrolling: 'touch',
125+
borderRadius: '4px',
126+
outline: 'none',
127+
padding: '20px'
128+
}
129+
}}
130+
...
131+
>
129132
```
130133

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

0 commit comments

Comments
 (0)