Skip to content

Commit 348ae6b

Browse files
committed
Update themed alert docs
1 parent 5fa0d5a commit 348ae6b

2 files changed

Lines changed: 20 additions & 43 deletions

File tree

docs/api.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,21 @@ An optional timeout (in milliseconds) before this alert will be automatically di
9090

9191
#### `classes`
9292

93-
JSS style overrides for the component. See the _Themed Alert_ example above for more information.
93+
JSS style overrides for the component. The following classes can be overridden:
94+
95+
* `alert`: CSS class applied to the root `div` of the `Alert`
96+
* `info`: CSS class applied to the root `div` for `info` alerts
97+
* `success`: CSS class applied to the root `div` for `success` alerts
98+
* `warning`: CSS class applied to the root `div` for `warning` alerts
99+
* `danger`: CSS class applied to the root `div` for `danger` alerts
100+
* `dismissable`: CSS class applied to the root `div` for alerts that can be dismissed
101+
* `close`: CSS class applied to the _dismiss_ button
102+
* `icon`: CSS class applied to the alert type icon
103+
* `msgContainer`: CSS class applied to the container holding the headline and message
104+
* `headline`: CSS class applied to the headline element (if provided)
105+
* `body`: CSS class applied to the message element itself
106+
107+
See the _Themed Alert_ example above.
94108

95109
---
96110

docs/demos/themed/code.example

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,12 @@ const ThemedAlert = props => {
44
};
55

66
const useStyleOverrides = createUseStyles({
7-
alert: {
8-
composes: "alert",
9-
marginBottom: 6,
10-
display: "inline-block",
11-
textAlign: "left"
12-
},
13-
info: {
14-
composes: "alert-info"
15-
},
167
success: {
17-
color: "#efd8f0",
18-
background: "#8f2ba1",
19-
borderColor: "#80237f",
20-
borderWidth: 15,
21-
borderRadius: 60
22-
},
23-
warning: {
24-
composes: "alert-warning",
25-
},
26-
danger: {
27-
composes: "alert-danger"
28-
},
29-
dismissable: {
30-
composes: "alert-dismissable"
31-
},
32-
close: {
33-
composes: "close"
34-
},
35-
msgContainer: {
36-
display: "inline-block"
37-
},
38-
icon: {
39-
verticalAlign: "top",
40-
fontSize: 18,
41-
paddingRight: 15,
42-
opacity: 0.2
43-
},
44-
headline: {
45-
margin: 0,
46-
marginBottom: 6
47-
},
48-
body: {
49-
maxWidth: "40em"
8+
color: "#efd8f0",
9+
background: "#8f2ba1",
10+
borderColor: "#80237f",
11+
borderWidth: 15,
12+
borderRadius: 60
5013
}
5114
});
5215

0 commit comments

Comments
 (0)