-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
flash.scss
155 lines (128 loc) · 2.97 KB
/
flash.scss
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// stylelint-disable selector-max-type, no-duplicate-selectors
// Default flash
.flash:not(.Banner) {
position: relative;
// stylelint-disable-next-line primer/spacing
padding: 20px $spacer-3;
border-style: $border-style;
border-width: $border-width;
border-radius: $border-radius;
p:last-child {
margin-bottom: 0;
}
.octicon {
// stylelint-disable-next-line primer/spacing
margin-right: 12px;
}
}
// Contain the flash messages
.flash-messages {
margin-bottom: $spacer-4;
}
// Close button
.flash-close:not(.Banner-close) {
float: right;
padding: $spacer-3;
margin: -$spacer-3;
text-align: center;
cursor: pointer;
// Undo `<button>` styles
background: none;
border: 0;
appearance: none;
&:hover {
opacity: 0.7;
}
&:active {
opacity: 0.5;
}
.octicon {
margin-right: 0;
}
}
// Action button
.flash-action:not(.Banner-actions) {
float: right;
// stylelint-disable-next-line primer/spacing
margin-top: -3px;
margin-left: $spacer-4;
background-clip: padding-box;
&.btn .octicon {
margin-right: $spacer-1;
color: var(--color-fg-muted);
}
&.btn-primary {
background-clip: border-box;
.octicon {
color: inherit;
}
}
}
//
// Color variations
//
.flash:not(.Banner) {
color: var(--color-fg-default);
background-image: linear-gradient(var(--color-accent-subtle), var(--color-accent-subtle));
border-color: var(--color-accent-muted);
.octicon {
color: var(--color-accent-fg);
}
}
.flash-warn:not(.Banner) {
color: var(--color-fg-default);
background-image: linear-gradient(var(--color-attention-subtle), var(--color-attention-subtle));
border-color: var(--color-attention-muted);
.octicon {
color: var(--color-attention-fg);
}
}
.flash-error:not(.Banner) {
color: var(--color-fg-default);
background-image: linear-gradient(var(--color-danger-subtle), var(--color-danger-subtle));
border-color: var(--color-danger-muted);
.octicon {
color: var(--color-danger-fg);
}
}
.flash-success:not(.Banner) {
color: var(--color-fg-default);
background-image: linear-gradient(var(--color-success-subtle), var(--color-success-subtle));
border-color: var(--color-success-muted);
.octicon {
color: var(--color-success-fg);
}
}
//
// Layout variations
//
.flash-full:not(.Banner) {
// stylelint-disable-next-line primer/spacing
margin-top: -1px;
border-width: $border-width 0;
border-radius: 0;
}
// A banner rendered at the top of the page.
.flash-banner {
position: fixed;
top: 0;
z-index: 90;
width: 100%;
border-top: 0;
border-right: 0;
border-left: 0;
border-radius: 0;
}
// Makes sure the background is opaque to cover any content underneath
.flash-full,
.flash-banner {
background-color: var(--color-canvas-default);
}
// FIXME deprecate this
.warning {
padding: $em-spacer-5;
// stylelint-disable-next-line primer/spacing
margin-bottom: 0.8em;
font-weight: $font-weight-bold;
background-color: var(--color-attention-subtle);
}