Skip to content

Commit 885701c

Browse files
authored
Merge pull request #322 from AramZS/fix-for-long-homepage-titles
Fix for long homepage title words causing horizontal scrolling on mobile
2 parents 9b2e861 + 236e95f commit 885701c

3 files changed

Lines changed: 84 additions & 38 deletions

File tree

.editorconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
indent_size = 4
11+
12+
# Matches multiple files with brace expansion notation
13+
# Set default charset
14+
[*.{js,py}]
15+
charset = utf-8
16+
17+
# 4 space indentation
18+
[*.py]
19+
indent_style = space
20+
indent_size = 4
21+
22+
# Tab indentation (no size specified)
23+
[Makefile]
24+
indent_style = tab
25+
26+
# Indentation override for all JS under lib directory
27+
[**.{js,njk}]
28+
indent_style = space
29+
indent_size = 2
30+
quote_type = single
31+
max_line_length = "80"
32+
33+
[*.{yaml,yml}]
34+
indent_style = space
35+
indent_size = 2
36+
37+
# Matches the exact files either package.json or .travis.yml
38+
[{package.json,.travis.yml}]
39+
indent_style = space
40+
indent_size = 2
41+
42+
[*.{sass,css}]
43+
indent_style = space
44+
indent_size = 2

src/styles/components/_content-grid.css

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,92 +4,89 @@
44
*/
55

66
:root {
7-
--padding-inline: 1rem;
8-
--paragraph-max-width: 864px;
9-
--content-max-width: 1400px;
7+
--padding-inline: 1rem;
8+
--paragraph-max-width: 864px;
9+
--content-max-width: 1400px;
1010

11-
--content-size: calc(
12-
(var(--content-max-width) - var(--paragraph-max-width))
13-
);
11+
--content-size: calc((var(--content-max-width) - var(--paragraph-max-width)));
1412
}
1513

1614
.content-grid {
17-
display: grid;
18-
grid-template-columns:
15+
display: grid;
16+
overflow: hidden;
17+
text-wrap: balance;
18+
grid-template-columns:
1919
[full-width-start] minmax(var(--padding-inline), 16rem)
2020
[breakout-start] 0
2121
[content-start] 0
2222
[paragraph-start]
23-
min(
24-
100% - (var(--padding-inline) * 2),
25-
var(--paragraph-max-width)
26-
)
23+
min(100% - (var(--padding-inline) * 2), var(--paragraph-max-width))
2724
[paragraph-end]
28-
minmax(0, var(--content-size))[content-end]
25+
minmax(0, var(--content-size)) [content-end]
2926
minmax(0, 7rem) [breakout-end]
3027
minmax(var(--padding-inline), 1fr) [full-width-end];
3128
}
3229

3330
.content-grid > *,
3431
.full-width > *,
3532
article.content-grid section > * {
36-
grid-column: content;
33+
grid-column: content;
3734
}
3835

3936
.content-grid > .paragraph,
4037
.full-width > .paragraph,
4138
article.content-grid section:not(.two-columns) > .paragraph {
42-
grid-column: paragraph;
39+
grid-column: paragraph;
4340
}
4441

4542
.content-grid > .breakout,
4643
.full-width > .breakout,
4744
article.content-grid section:not(.two-columns) > .breakout {
48-
grid-column: breakout;
45+
grid-column: breakout;
4946
}
5047

5148
.content-grid > .full-width,
5249
article.content-grid section:not(.two-columns) {
53-
grid-column: full-width;
50+
grid-column: full-width;
5451

55-
display: grid;
56-
grid-template-columns: inherit;
52+
display: grid;
53+
grid-template-columns: inherit;
5754
}
5855

5956
/*
6057
* List of article elements that must be paragraph width
6158
*/
6259
article.content-grid p,
6360
article.content-grid ul {
64-
grid-column: paragraph;
61+
grid-column: paragraph;
6562
}
6663

6764
/*
6865
* List of article elements that must be breakout width
6966
*/
7067
article.content-grid pre {
71-
grid-column: breakout;
68+
grid-column: breakout;
7269
}
7370

7471
.two-columns {
75-
grid-column: content;
76-
display: grid;
77-
grid-template-columns: 1fr 1fr;
78-
gap: 2rem;
72+
grid-column: content;
73+
display: grid;
74+
grid-template-columns: 1fr 1fr;
75+
gap: 2rem;
7976
}
8077

8178
.two-columns__paragraph {
82-
grid-template-columns: minmax(auto, var(--paragraph-max-width)) 1fr;
79+
grid-template-columns: minmax(auto, var(--paragraph-max-width)) 1fr;
8380
}
8481

8582
.two-columns > *,
8683
article.content-grid section.two-columns > * {
87-
grid-column: auto;
84+
grid-column: auto;
8885
}
8986

9087
@media (max-width: 864px) {
91-
.two-columns {
92-
grid-template-columns: 1fr;
93-
gap: 0;
94-
}
88+
.two-columns {
89+
grid-template-columns: 1fr;
90+
gap: 0;
91+
}
9592
}

src/styles/main.css

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ blockquote {
6060
}
6161

6262
aside.citation {
63-
border-left: 3px solid var(--foreground-muted);
64-
padding-left: 1em;
63+
border-left: 3px solid var(--foreground-muted);
64+
padding-left: 1em;
6565
}
6666

6767
aside.citation blockquote {
68-
border-left: none;
69-
padding-left: 0;
68+
border-left: none;
69+
padding-left: 0;
7070
}
7171

7272
pre {
@@ -150,6 +150,12 @@ main {
150150
margin-bottom: 2em;
151151
}
152152

153+
main > section {
154+
text-wrap: balance;
155+
text-wrap: pretty;
156+
overflow: hidden;
157+
}
158+
153159
article > header {
154160
padding: 2em 0 1em 0;
155161
}
@@ -285,7 +291,6 @@ article.resource.bookmark .btn-list li {
285291
height: 31px;
286292
}
287293

288-
289294
.tags-list ul {
290295
display: grid;
291296
width: 100%;
@@ -453,7 +458,7 @@ ul.alphabet {
453458
top: -200px;
454459
}
455460

456-
.page-meta{
461+
.page-meta {
457462
position: relative;
458463
background-color: var(--background-muted);
459464
border-top: 3px solid var(--accent);
@@ -491,7 +496,7 @@ ul.alphabet {
491496
padding: 0 1em;
492497
}
493498

494-
body > header > div.container{
499+
body > header > div.container {
495500
margin-top: 40px;
496501
}
497502
}

0 commit comments

Comments
 (0)