Skip to content

Commit 7cf8463

Browse files
committed
[doc] Update docs to include details about CSS classes
1 parent eee9431 commit 7cf8463

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

+13-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Accessible modal dialog component for React.JS
99
isOpen={bool}
1010
onRequestClose={fn}
1111
closeTimeoutMS={n}
12-
style={customStyle}>
13-
12+
style={customStyle}
13+
>
1414
<h1>Modal Content</h1>
1515
<p>Etc.</p>
1616
</Modal>
1717
```
18+
1819
## Styles
1920
Styles are passed as an object with 2 keys, 'overlay' and 'content' like so
2021
```js
@@ -48,9 +49,17 @@ Styles are passed as an object with 2 keys, 'overlay' and 'content' like so
4849
Styles passed to the modal are merged in with the above defaults and applied to their respective elements.
4950
At this time, media queries will need to be handled by the consumer.
5051

51-
###Overriding styles globally
52+
### Using CSS Classes
53+
54+
If you prefer not to use inline styles or are unable to do so in your project,
55+
you can pass `className` and `overlayClassName` props to the Modal. If you do
56+
this then none of the default styles will apply and you will have full control
57+
over styling via CSS.
58+
5259

53-
The default styles above are available on `Modal.defaultStyles`.
60+
### Overriding styles globally
61+
The default styles above are available on `Modal.defaultStyles`. Changes to this
62+
object will apply to all instances of the modal.
5463

5564
## Examples
5665
Inside an app:

0 commit comments

Comments
 (0)