Skip to content

Commit 5996c87

Browse files
committed
Update Typography
1 parent bb88148 commit 5996c87

File tree

5 files changed

+83
-49
lines changed

5 files changed

+83
-49
lines changed

assets/css/base.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body {
1313

1414
html {
1515
font-size: calc(var(--cs-base-font-size) * 1px);
16-
line-height: 1.35;
16+
line-height: var(--cs-line-height-body);
1717
overflow-y: scroll;
1818
@media (min-width: 38em) {
1919
font-size: 18px;
@@ -24,6 +24,7 @@ body {
2424
font-family: var(--cs-base-font-family-plain);
2525
color: var(--cs-font-color);
2626
background-color: var(--cs-bg);
27+
font-size: var(--cs-font-size-body);
2728
-webkit-text-size-adjust: 100%;
2829
-ms-text-size-adjust: 100%;
2930
}
@@ -54,12 +55,12 @@ a {
5455
img {
5556
display: block;
5657
max-width: 100%;
57-
margin: 0 0 1rem;
58+
margin: 0 0 var(--cs-space-4);
5859
border-radius: 5px;
5960
}
6061

6162
table {
62-
margin-bottom: 1rem;
63+
margin-bottom: var(--cs-space-4);
6364
width: 100%;
6465
font-size: 85%;
6566
border: 1px solid #e5e5e5;
@@ -68,7 +69,7 @@ table {
6869

6970
td,
7071
th {
71-
padding: 0.25rem 0.5rem;
72+
padding: var(--cs-space-2) var(--cs-space-4);
7273
border: 1px solid #e5e5e5;
7374
}
7475

assets/css/layout.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
.layout {
22
&__row {
33
max-width: calc(820 / var(--cs-base-font-size) * 1rem);
4-
padding-left: 1.5rem;
5-
padding-right: 1.5rem;
4+
padding-left: var(--cs-space-6);
5+
padding-right: var(--cs-space-6);
66
margin-left: auto;
77
margin-right: auto;
88
&--header {
9-
margin-top: calc(var(--cs-base-gutter) * 4);
9+
margin-top: var(--cs-space-12);
1010
}
1111
&--main {
12-
margin-top: calc(var(--cs-base-gutter) * 4);
12+
margin-top: var(--cs-space-12);
1313
}
1414
&--footer {
15-
margin-top: 2em;
16-
padding-bottom: 1rem;
15+
margin-top: var(--cs-space-12);
16+
padding-bottom: var(--cs-space-4);
1717
}
1818
}
1919
}

assets/css/posts.css

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
.posts-grid {
22
margin: 0 auto;
3-
max-width: calc(570/var(--cs-base-font-size) * 1rem);
3+
max-width: calc(570 / var(--cs-base-font-size) * 1rem);
44
&__item {
55
width: 100%;
6-
margin-bottom: 2.6rem;
6+
margin-bottom: var(--cs-space-10);
77
}
88
&__summary {
99
font-weight: 300;
10-
margin-bottom: 0.3rem;
11-
line-height: 1.5rem;
10+
margin-bottom: var(--cs-space-2);
11+
line-height: 1.6;
1212
color: var(--cs-font-color);
1313
}
14-
&__header{
14+
&__header {
1515
display: flex;
1616
align-items: baseline;
1717
h2 {
@@ -28,7 +28,7 @@
2828
text-decoration: none;
2929
margin-bottom: 0.2rem;
3030
-webkit-transition: all 0.25s 0s ease;
31-
transition: all 0.25s 0s ease;
31+
transition: all 0.25s 0s ease;
3232
&:hover {
3333
h3 {
3434
color: var(--cs-link-active-color);
@@ -38,14 +38,13 @@
3838
}
3939
&__meta {
4040
color: #6f6f6f;
41-
font-size: .8em;
41+
font-size: 0.8em;
4242
a {
4343
color: #e03030;
4444
}
4545
}
4646
}
4747

48-
4948
.page,
5049
.post {
5150
max-width: 700px;
@@ -60,14 +59,14 @@
6059
color: #e03030;
6160
}
6261
.post__info {
63-
margin-bottom: .5rem;
62+
margin-bottom: var(--cs-space-2);
6463
text-align: center;
6564
}
6665

6766
.post__date {
6867
display: inline-block;
69-
margin-top: -.5rem;
70-
margin-bottom: 1rem;
68+
margin-top: calc(-1 * var(--cs-space-2));
69+
margin-bottom: var(--cs-space-4);
7170
color: #585858;
7271
}
7372

@@ -77,6 +76,7 @@
7776
.post__content {
7877
padding-bottom: 2rem;
7978
line-height: 1.6rem;
79+
8080
h2 {
8181
margin-bottom: 0.9rem;
8282
}
@@ -91,14 +91,14 @@
9191
padding-bottom: 0.5rem;
9292
}
9393
li:before {
94-
content: '→';
94+
content: "→";
9595
position: absolute;
9696
left: 0.8rem;
9797
font-weight: bold;
9898
}
9999
}
100100
.post__footer {
101-
border-top: 1px solid #ABABAB;
101+
border-top: 1px solid #ababab;
102102
padding-top: 1rem;
103103
font-size: 15px;
104104
}

assets/css/type.css

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,60 @@
1-
h1, h2, h3, h4, h5, h6 {
2-
margin-bottom: .5rem;
3-
font-weight: bold;
4-
line-height: 1.25;
1+
h1,
2+
h2,
3+
h3,
4+
h4,
5+
h5,
6+
h6 {
7+
margin-top: 0;
8+
margin-bottom: var(--cs-space-3);
9+
font-weight: 700;
10+
line-height: var(--cs-line-height-headings);
511
color: var(--cs-heading-color);
612
text-rendering: optimizeLegibility;
713
}
814

915
h1 {
10-
font-size: 3rem;
16+
font-size: var(--cs-font-size-h1);
1117
}
1218
h2 {
13-
margin-top: 2rem;
14-
font-size: 1.4rem;
19+
margin-top: var(--cs-space-10);
20+
font-size: var(--cs-font-size-h2);
1521
}
1622

1723
h3 {
18-
margin-top: 1.5rem;
19-
font-size: 1.25rem;
24+
margin-top: var(--cs-space-8);
25+
font-size: var(--cs-font-size-h3);
2026
}
2127

22-
h4, h5, h6 {
23-
margin-top: 1rem;
24-
font-size: 1rem;
28+
h4,
29+
h5,
30+
h6 {
31+
margin-top: var(--cs-space-6);
32+
font-size: var(--cs-font-size-h4);
2533
}
2634

2735
p {
2836
margin-top: 0;
29-
margin-bottom: 1.3rem;
30-
font-size: 19px;
37+
margin-bottom: var(--cs-space-5);
3138
}
3239

3340
strong {
3441
color: #303030;
35-
font-weight: 500;
42+
font-weight: 600;
3643
}
3744

38-
ul, ol, dl {
45+
ul,
46+
ol,
47+
dl {
3948
margin-top: 0;
40-
margin-bottom: 1rem;
49+
margin-bottom: var(--cs-space-5);
4150
}
4251

4352
dt {
4453
font-weight: bold;
4554
}
4655

4756
dd {
48-
margin-bottom: .5rem;
57+
margin-bottom: 0.5rem;
4958
}
5059

5160
abbr {
@@ -61,30 +70,31 @@ abbr {
6170
}
6271

6372
blockquote {
64-
padding: .5rem 1rem;
65-
margin: 0 0rem 1.3rem 0;
73+
padding: var(--cs-space-2) var(--cs-space-4);
74+
margin: 0 0 var(--cs-space-5) 0;
6675
color: #7a7a7a;
67-
border-left: .25rem solid #e5e5e5;
76+
border-left: 0.25rem solid #e5e5e5;
6877

6978
p:last-child {
7079
margin-bottom: 0;
7180
}
7281

7382
@media (min-width: 30em) {
74-
padding-right: 5rem;
75-
padding-left: 1.25rem;
83+
padding-right: var(--cs-space-12);
84+
padding-left: calc(var(--cs-space-4) + 0.25rem);
7685
}
7786
}
7887

79-
8088
a[href^="#fn:"],
8189
a[href^="#fnref:"] {
8290
display: inline-block;
83-
margin-left: .1rem;
91+
margin-left: 0.1rem;
8492
font-weight: bold;
8593
}
8694

95+
/* reverted link decoration overrides */
96+
8797
.footnotes {
88-
margin-top: 2rem;
98+
margin-top: var(--cs-space-8);
8999
font-size: 85%;
90100
}

assets/css/variables.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,29 @@
1313
sans-serif;
1414
--cs-base-font-size: 16;
1515
--cs-base-gutter: 15px;
16+
17+
/* Typography rhythm */
18+
--cs-line-height-body: 1.6;
19+
--cs-line-height-headings: 1.2;
20+
21+
/* Fluid type scale */
22+
--cs-font-size-body: clamp(1rem, 0.98rem + 0.2vw, 1.125rem);
23+
--cs-font-size-small: clamp(0.875rem, 0.86rem + 0.2vw, 0.95rem);
24+
--cs-font-size-h1: clamp(2rem, 1.6rem + 2.5vw, 3rem);
25+
--cs-font-size-h2: clamp(1.5rem, 1.3rem + 1.2vw, 2rem);
26+
--cs-font-size-h3: clamp(1.25rem, 1.15rem + 0.6vw, 1.5rem);
27+
--cs-font-size-h4: clamp(1.125rem, 1.1rem + 0.2vw, 1.25rem);
28+
29+
/* Spacing scale */
30+
--cs-space-1: 0.25rem;
31+
--cs-space-2: 0.5rem;
32+
--cs-space-3: 0.75rem;
33+
--cs-space-4: 1rem;
34+
--cs-space-5: 1.25rem;
35+
--cs-space-6: 1.5rem;
36+
--cs-space-8: 2rem;
37+
--cs-space-10: 2.5rem;
38+
--cs-space-12: 3rem;
1639
}
1740

1841
/* @media (prefers-color-scheme: dark) {

0 commit comments

Comments
 (0)