Skip to content

Commit 031b05e

Browse files
committed
Make some minor improvements to the blog CSS
In particular, remove units on `line-height` properties, fix some header sizes, and add an indicator of which footnote is focused when linked to.
1 parent 6a803aa commit 031b05e

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

gulpfile.coffee

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ import compileSass from 'gulp-sass'
88
import uglify from 'gulp-uglify'
99

1010
export js = ->
11-
gulp.src './coffee/**/*.coffee', sourcemaps: true
11+
gulp.src 'coffee/**/*.coffee', sourcemaps: true
1212
.pipe compileCoffee()
1313
.pipe concat 'application.js'
1414
.pipe uglify()
1515
.pipe rename extname: '.min.js'
16-
.pipe gulp.dest './output/js/'
16+
.pipe gulp.dest 'output/js/'
1717

1818
export css = ->
19-
gulp.src './scss/**/*.scss', sourcemaps: true
19+
gulp.src 'scss/**/*.scss', sourcemaps: true
2020
.pipe compileSass().on 'error', compileSass.logError
2121
.pipe autoprefixer()
2222
.pipe rename extname: '.min.css'
23-
.pipe gulp.dest './output/css/'
23+
.pipe gulp.dest 'output/css/'
2424

2525
export images = ->
26-
gulp.src './images/**/*'
27-
.pipe gulp.dest './output/img/'
26+
gulp.src 'images/**/*'
27+
.pipe gulp.dest 'output/img/'
2828

2929
export build = gulp.parallel js, css, images
3030

3131
export watch = ->
32-
gulp.watch './coffee/**/*.coffee', js
33-
gulp.watch './scss/**/*.scss', css
34-
gulp.watch './images/**/*', images
32+
gulp.watch 'coffee/**/*.coffee', js
33+
gulp.watch 'scss/**/*.scss', css
34+
gulp.watch 'images/**/*', images
3535

36-
export default gulp.series build
36+
export default build

scss/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $color-primary: #e45b5b;
77
$color-disabled: #ac9c9c;
88
$color-section-background: #fffafa;
99
$color-section-background-border: #fef8f8;
10+
$color-section-background-highlight: #fff5f5;
1011
$color-table-border: #fff1f1;
1112

1213
$text-color-light: lighten($color-primary, 30%);

scss/application.scss

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,27 @@ h1, h2, h3, h4, h5, h6 {
4040
h1 {
4141
font-size: 2em;
4242
font-weight: 700;
43-
line-height: 1.4em;
43+
line-height: 1.4;
4444
margin-bottom: 0.4em;
4545

4646
@media (min-width: 575px) {
4747
font-size: 2.3em;
48-
line-height: 1.4em;
4948
}
5049
}
5150

5251
h2 {
5352
font-size: 1.75em;
54-
line-height: 1.5em;
53+
line-height: 1.5;
5554
margin-top: 2em;
5655

5756
@media (min-width: 800px) {
5857
font-size: 2em;
5958
}
6059
}
6160

62-
h3 {
63-
font-size: 1.5em;
64-
line-height: 1em;
65-
}
66-
67-
h4 {
68-
font-size: 1.17em;
69-
line-height: 1em;
70-
}
61+
h3 { font-size: 1.5em; }
62+
h4 { font-size: 1.17em; }
63+
h5 { font-size: 1.1em; }
7164

7265
// -----------------------------------------------------------------------------
7366

@@ -91,12 +84,11 @@ body > section[role=main] {
9184
flex: 1;
9285
font-size: 1.1em;
9386
font-weight: 300;
94-
line-height: 2em;
87+
line-height: 2;
9588
padding: 0 $content-padding;
9689

9790
@media (max-width: 550px) {
9891
font-size: 0.9em;
99-
line-height: 2em;
10092
}
10193

10294
& > .content {
@@ -188,12 +180,12 @@ body > section[role=main] {
188180

189181
@media (max-width: 700px) {
190182
font-size: 0.9em;
191-
line-height: 1.9em;
183+
line-height: 1.9;
192184
}
193185

194186
@media (max-width: 500px) {
195187
font-size: 0.8em;
196-
line-height: 1.8em;
188+
line-height: 1.8;
197189
}
198190

199191
@media (min-width: 800px) {
@@ -296,8 +288,17 @@ article.inline {
296288

297289
.footnotes {
298290
font-size: small;
299-
line-height: 2em;
291+
line-height: 2;
300292
margin-top: 4em;
293+
294+
li:target {
295+
background-color: $color-section-background-highlight;
296+
border-radius: 3px;
297+
// We want the background to extend past both the edges of the element and
298+
// the list bullet itself, which is easiest to do with two overlapping shadows.
299+
box-shadow: -1.5em 0 0 0.5em $color-section-background-highlight,
300+
0.5em 0 0 0.5em $color-section-background-highlight;
301+
}
301302
}
302303

303304
article.main > footer {

0 commit comments

Comments
 (0)