Skip to content

Commit 1642310

Browse files
committed
index: Use fluid space scale
1 parent 8859cfe commit 1642310

File tree

2 files changed

+47
-68
lines changed

2 files changed

+47
-68
lines changed

app/styles/index.module.css

Lines changed: 38 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
.title-header {
2-
text-align: center;
1+
.hero-buttons {
2+
display: flex;
3+
flex-wrap: wrap;
4+
justify-content: center;
5+
gap: var(--space-s);
36
border-bottom: 5px solid var(--gray-border);
4-
margin-top: 25px;
5-
padding-bottom: 40px;
6-
7-
@media only screen and (max-width: 570px) {
8-
margin-top: 0;
9-
}
10-
11-
h1 {
12-
font-size: 50px;
13-
@media only screen and (max-width: 370px) {
14-
font-size: 40px;
15-
}
16-
}
17-
18-
.links a:not(:first-child) {
19-
margin: 0 20px;
20-
@media only screen and (max-width: 570px) {
21-
clear: both;
22-
margin: 20px 0 0 0;
23-
}
24-
}
7+
margin-top: var(--space-s);
8+
padding-bottom: var(--space-l);
259
}
2610

2711
.hero-button {
@@ -33,50 +17,47 @@
3317
}
3418

3519
.blurb {
36-
margin: 30px 0 40px 0;
20+
margin: var(--space-l) var(--space-s);
3721
display: flex;
22+
gap: var(--space-l);
3823

39-
.intro { flex: 6; line-height: 25px; padding: 10px;}
40-
41-
.stats {
42-
flex: 4;
43-
display: flex;
24+
@media only screen and (max-width: 650px) {
4425
flex-direction: column;
26+
align-items: center;
27+
}
28+
}
4529

46-
padding: 10px;
30+
.intro {
31+
flex: 6;
32+
line-height: 1.5;
33+
}
4734

48-
.crates { margin-top: 16px; }
49-
}
35+
.stats {
36+
flex: 4;
37+
display: flex;
38+
flex-direction: column;
5039

51-
@media only screen and (max-width: 530px) {
52-
flex-direction: column;
53-
.stats {
54-
border: none;
55-
margin: 32px auto 0;
56-
}
40+
> * + * {
41+
margin-top: var(--space-s);
5742
}
5843
}
5944

6045
.lists {
61-
display: flex;
62-
flex-wrap: wrap;
63-
justify-content: left;
64-
65-
> section {
66-
margin: 0;
67-
padding: 0 15px;
68-
width: 33.33%;
69-
@media only screen and (max-width: 750px) {
70-
width: 50%;
71-
}
72-
@media only screen and (max-width: 550px) {
73-
width: 100%;
74-
}
46+
display: grid;
47+
grid-template-columns: 1fr 1fr 1fr;
48+
gap: var(--space-s);
49+
padding: 0 var(--space-s);
50+
51+
@media only screen and (max-width: 750px) {
52+
grid-template-columns: 1fr 1fr;
53+
}
54+
55+
@media only screen and (max-width: 550px) {
56+
grid-template-columns: 1fr;
7557
}
7658

7759
h2 {
78-
font-size: 105%;
79-
line-height: 20px;
60+
font-size: 1.05rem;
8061
}
8162
}
8263

@@ -90,15 +71,15 @@
9071
}
9172

9273
.error-message {
93-
line-height: 25px;
74+
line-height: 1.5;
9475
}
9576

9677
.try-again-button {
9778
composes: yellow-button from './shared/buttons.module.css';
9879
align-self: center;
99-
margin: 20px 0;
80+
margin: var(--space-s) 0;
10081

10182
.spinner {
102-
margin-left: 7px;
83+
margin-left: var(--space-2xs);
10384
}
10485
}

app/templates/index.hbs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<div local-class='title-header'>
2-
<div local-class='links'>
3-
<a href="https://doc.rust-lang.org/cargo/getting-started/installation.html" local-class="hero-button" data-test-install-cargo-link>
4-
{{svg-jar "download-arrow" local-class="icon"}}
5-
Install Cargo
6-
</a>
1+
<div local-class="hero-buttons">
2+
<a href="https://doc.rust-lang.org/cargo/getting-started/installation.html" local-class="hero-button" data-test-install-cargo-link>
3+
{{svg-jar "download-arrow" local-class="icon"}}
4+
Install Cargo
5+
</a>
76

8-
<a href='https://doc.rust-lang.org/cargo/guide/' local-class="hero-button">
9-
{{svg-jar "flag" local-class="icon"}}
10-
Getting Started
11-
</a>
12-
</div>
7+
<a href='https://doc.rust-lang.org/cargo/guide/' local-class="hero-button">
8+
{{svg-jar "flag" local-class="icon"}}
9+
Getting Started
10+
</a>
1311
</div>
1412

1513
<div local-class='blurb'>

0 commit comments

Comments
 (0)