blob: e2c71c50b43f155ef2f6bb16508a6cae119c33b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.message--level-error {
--message-background-color: var(--error-background);
--message-border-color: var(--error-border);
--message-color: var(--error-text);
--message-icon-color: var(--error-icon);
}
.message--level-info {
--message-background-color: var(--grey-20);
--message-border-color: transparent;
--message-color: var(--grey-90);
--message-icon-color: var(--grey-90);
}
.message--level-warning {
--message-background-color: var(--warning-background);
--message-border-color: var(--warning-border);
--message-color: var(--warning-text);
--message-icon-color: var(--warning-icon);
}
/*
* Layout of the message
*
* +--------+-----------------+----------+
* | Icon | Message content | closing |
* | | (several lines) | button |
* | | ( ... ) |(optional)|
* +--------+-----------------+----------+
*/
.message {
background-color: var(--message-background-color);
border: 1px solid var(--message-border-color);
border-radius: var(--base-unit);
color: var(--message-color);
display: grid;
grid-column-gap: var(--base-unit);
grid-template-columns: calc(var(--base-unit) * 6) 1fr auto;
grid-template-areas:
"icon body button";
margin: calc(var(--base-unit) * 2) 0;
padding: var(--base-unit);
-moz-context-properties: fill;
}
.message__icon {
margin: var(--base-unit);
fill: var(--message-icon-color);
grid-area: icon;
}
.message__body {
align-self: center;
font-size: var(--message-font-size);
font-weight: 400;
grid-area: body;
line-height: 1.6;
}
.message__button {
grid-area: button;
fill: var(--message-icon-color);
}
.message__button:hover {
/* reverse colors with icon when hover state */
background-color: var(--message-icon-color);
fill: var(--message-background-color);
}
.message__button:active {
/* reverse colors with text when active state */
background-color: var(--message-color);
fill: var(--message-background-color);
}
|