Skip to content

Commit 2290c8a

Browse files
authored
Merge pull request #828 from marineb/826-updates-alerts.scss-BEM-refactor
Updates .alerts.scss to be closer to BEM methodology.
2 parents 6fe2dde + 8860421 commit 2290c8a

File tree

1 file changed

+50
-43
lines changed

1 file changed

+50
-43
lines changed

app/styles/_alerts.scss

Lines changed: 50 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,63 @@
11
.flash {
22
cursor: pointer;
3+
}
34

4-
.alert {
5-
.container {
6-
position: relative;
7-
}
5+
.alert {
6+
.container {
7+
position: relative;
8+
}
89

9-
&.alert-success .full-width-container,
10-
&.alert-success .fixed-flash-inner {
11-
background: $dark-blue;
12-
color: white;
13-
}
10+
// regular flash message full-width-container, displayed full width
11+
// almost on top of the page
12+
.full-width-container {
13+
margin: 0 -10px 10px;
14+
padding: 5px 10px 5px 35px;
15+
}
1416

15-
&.alert-danger .full-width-container,
16-
&.alert-danger .fixed-flash-inner {
17-
background: $red;
18-
color: white;
19-
}
17+
// fixed positioned flash message container, displayed at the very top of the page
18+
// as wide as the text, centered
19+
.fixed-flash {
20+
position: fixed;
21+
top: 0; left: 0; right: 0;
22+
text-align: center;
2023

21-
// regular flash message full-width-container, displayed full width
22-
// almost on top of the page
23-
.full-width-container {
24-
margin: 0 -10px 10px;
25-
padding: 5px 10px 5px 35px;
26-
}
24+
.fixed-flash-inner {
25+
border-radius: 4px;
26+
cursor: pointer;
27+
display: inline-block;
28+
padding: 5px 20px;
29+
margin-top: 15px;
2730

28-
// fixed positioned flash message container, displayed at the very top of the page
29-
// as wide as the text, centered
30-
.fixed-flash {
31-
position: fixed;
32-
top: 0; left: 0; right: 0;
33-
text-align: center;
34-
35-
.fixed-flash-inner {
36-
border-radius: 4px;
37-
cursor: pointer;
38-
display: inline-block;
39-
padding: 5px 20px;
40-
margin-top: 15px;
41-
42-
@include fadeInDown(0.6s);
43-
44-
p {
45-
margin: 5px 0;
46-
}
31+
@include fadeInDown(0.6s);
32+
33+
p {
34+
margin: 5px 0;
4735
}
4836
}
4937
}
38+
}
5039

51-
.close {
52-
left: -20px;
53-
position: absolute;
54-
top: -3px;
40+
// ember-cli-flash package doesn't currently support custom classes.
41+
// but they will in their 2.0.0 release. https://github.com/poteto/ember-cli-flash/issues/99
42+
// Once they do so, the following classes can be renamed after BEM standards (ex: .alert--state-danger)
43+
.alert-success {
44+
.full-width-container,
45+
.fixed-flash-inner {
46+
background: $dark-blue;
47+
color: white;
5548
}
5649
}
50+
51+
.alert-danger {
52+
.full-width-container,
53+
.fixed-flash-inner {
54+
background: $red;
55+
color: white;
56+
}
57+
}
58+
59+
.close {
60+
left: -20px;
61+
position: absolute;
62+
top: -3px;
63+
}

0 commit comments

Comments
 (0)