Skip to content

Commit 0e86a34

Browse files
committed
Extract Footer component
1 parent a24773a commit 0e86a34

File tree

4 files changed

+57
-55
lines changed

4 files changed

+57
-55
lines changed

app/components/footer.hbs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<footer local-class="footer">
2+
<div local-class='after-main-links'>
3+
<a href='https://doc.rust-lang.org/cargo/getting-started/installation.html'>Install</a>
4+
<span local-class="sep">|</span>
5+
<a href='https://doc.rust-lang.org/cargo/'>Getting Started</a>
6+
<span local-class="sep">|</span>
7+
<a href='https://doc.rust-lang.org/cargo/guide/'>Guide</a>
8+
<span local-class="sep">|</span>
9+
<a href='mailto:[email protected]'>Send us an email</a>
10+
<span local-class="sep">|</span>
11+
<a href='https://www.rust-lang.org/policies/security'>Report a security issue</a>
12+
<span local-class="sep">|</span>
13+
<a href='https://www.rust-lang.org/policies/privacy'>Privacy notice</a>
14+
<span local-class="sep">|</span>
15+
<LinkTo @route="policies">Policies</LinkTo>
16+
</div>
17+
</footer>

app/components/footer.module.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.footer {
2+
display: flex;
3+
justify-content: center;
4+
width: 100%;
5+
}
6+
7+
.sep {
8+
margin: 0 10px;
9+
color: var(--separator-color);
10+
}
11+
12+
.after-main-links {
13+
composes: width-limit from '../styles/application.module.css';
14+
15+
margin: 40px;
16+
text-align: center;
17+
18+
a { color: white; }
19+
a:hover { color: darken(white, 10%); }
20+
21+
@media only screen and (max-width: 450px) {
22+
margin: 20px;
23+
.sep { display: none; }
24+
display: flex;
25+
flex-direction: column;
26+
align-items: center;
27+
28+
a {
29+
width: 50%;
30+
font-size: 110%;
31+
padding: 5px;
32+
33+
&:not(:first-child) {
34+
border-top: 1px solid var(--separator-color);
35+
}
36+
}
37+
}
38+
}

app/styles/application.module.css

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,10 @@ noscript {
7171
}
7272
}
7373

74-
.main,
75-
.footer {
74+
.main {
7675
display: flex;
7776
justify-content: center;
7877
width: 100%;
79-
}
80-
81-
.sep {
82-
margin: 0 10px;
83-
color: var(--separator-color);
84-
}
85-
86-
.main {
8778
background-color: var(--main-bg);
8879
color: var(--main-color);
8980
}
@@ -95,34 +86,6 @@ noscript {
9586
margin: 15px;
9687
}
9788

98-
.after-main-links {
99-
composes: width-limit;
100-
101-
margin: 40px;
102-
text-align: center;
103-
104-
a { color: white; }
105-
a:hover { color: darken(white, 10%); }
106-
107-
@media only screen and (max-width: 450px) {
108-
margin: 20px;
109-
.sep { display: none; }
110-
display: flex;
111-
flex-direction: column;
112-
align-items: center;
113-
114-
a {
115-
width: 50%;
116-
font-size: 110%;
117-
padding: 5px;
118-
119-
&:not(:first-child) {
120-
border-top: 1px solid var(--separator-color);
121-
}
122-
}
123-
}
124-
}
125-
12689
.fork-me {
12790
position: absolute;
12891
top: 0;

app/templates/application.hbs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,7 @@
1212
</div>
1313
</main>
1414

15-
<footer local-class="footer">
16-
<div local-class='after-main-links'>
17-
<a href='https://doc.rust-lang.org/cargo/getting-started/installation.html'>Install</a>
18-
<span local-class="sep">|</span>
19-
<a href='https://doc.rust-lang.org/cargo/'>Getting Started</a>
20-
<span local-class="sep">|</span>
21-
<a href='https://doc.rust-lang.org/cargo/guide/'>Guide</a>
22-
<span local-class="sep">|</span>
23-
<a href='mailto:[email protected]'>Send us an email</a>
24-
<span local-class="sep">|</span>
25-
<a href='https://www.rust-lang.org/policies/security'>Report a security issue</a>
26-
<span local-class="sep">|</span>
27-
<a href='https://www.rust-lang.org/policies/privacy'>Privacy notice</a>
28-
<span local-class="sep">|</span>
29-
<LinkTo @route="policies">Policies</LinkTo>
30-
</div>
31-
</footer>
15+
<Footer/>
3216

3317
<a href='https://github.com/rust-lang/crates.io' local-class='fork-me'>
3418
<img src='/assets/forkme.png' alt="Fork me on GitHub">

0 commit comments

Comments
 (0)