Skip to content

Commit 9a4d1b7

Browse files
improve css
Signed-off-by: Henry Gressmann <[email protected]>
1 parent dde6ff4 commit 9a4d1b7

File tree

5 files changed

+47
-25
lines changed

5 files changed

+47
-25
lines changed

content/2023/spaify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ date = 2023-05-14
55
aliases = ["spaify"]
66

77
[taxonomies]
8-
tags = ["npm", "typescript", "open source", "javascript", "spa", "static site", "web development"]
8+
tags = ["typescript", "open source", "webdev"]
99
+++
1010

1111
By default, when you click a link on a website, the browser will load the new page from the server and replace the current page with the new one. This is the default behaviour for static sites, and it works well. Spaify lets you skip this step and load the new page in the background, so that when you click a link, the new page is already loaded and ready to be displayed. This makes the page transition seamless, and it's a great way to improve the user experience of your site, and progressively enhance it. And the best part is that it's super easy to use, and it's less than 1kb of JavaScript (minified and gzipped).

sass/footer.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
position: absolute;
55
display: flex;
66
bottom: 0;
7-
padding: 2rem 2rem;
7+
padding: 2rem 2.4rem;
88
flex-grow: 0;
99
width: 100%;
1010

@@ -28,7 +28,7 @@
2828
display: flex;
2929
flex-direction: row;
3030
align-items: center;
31-
font-size: 1rem;
31+
font-size: 1.1em;
3232
color: var(--light-color-secondary);
3333

3434
&--user {

sass/main.scss

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ body {
1515
margin: 0;
1616
padding: 0;
1717
font-family: var(--font-family-text);
18-
font-size: 1rem;
18+
font-size: 1.2rem;
1919
line-height: 1.54;
2020
background-color: var(--background);
2121
color: var(--color);
@@ -41,10 +41,10 @@ h6 {
4141
}
4242

4343
h1 {
44-
font-size: 2rem;
44+
font-size: 1.4em;
4545
font-weight: 600;
46-
margin-top: 3rem;
47-
margin-bottom: 1rem;
46+
margin-top: 1.5rem;
47+
margin-bottom: .4rem;
4848
color: var(--color);
4949
// background: linear-gradient(93deg, #00ffe8 20%, #effbff 70%);
5050
// -webkit-background-clip: text;
@@ -55,19 +55,19 @@ h1 {
5555
}
5656

5757
h2 {
58-
margin-top: 1rem;
58+
font-size: 1.2em;
5959
font-size: 1.3rem;
6060
font-weight: 400;
6161
}
6262

6363
h3 {
64-
font-size: 1.2rem;
64+
font-size: 1.1em;
6565
}
6666

6767
h4,
6868
h5,
6969
h6 {
70-
font-size: 1.15rem;
70+
font-size: 1em;
7171
}
7272

7373
a {
@@ -171,7 +171,8 @@ code {
171171
font-feature-settings: normal;
172172
background: var(--accent-alpha-20);
173173
padding: 1px 6px;
174-
font-size: 0.95rem;
174+
font-size: 0.8rem;
175+
line-height: 1.5;
175176
border-radius: 3px;
176177
}
177178

@@ -180,6 +181,11 @@ code.filename {
180181
font-size: 0.85rem;
181182
margin: 0.4rem;
182183
position: absolute;
184+
line-height: 1.2;
185+
186+
@media (max-width: $phone-max-width) {
187+
margin-left: -1rem;
188+
}
183189
}
184190

185191
pre {
@@ -191,17 +197,26 @@ pre {
191197
margin-top: 0;
192198
border-radius: 6px;
193199
white-space: pre-wrap;
194-
line-height: 1.3;
200+
line-height: 1;
195201
// @media (max-width: $phone-max-width) {
196202
// white-space: pre-wrap;
197203
// word-wrap: break-word;
198204
// }
199205

206+
@media (max-width: $phone-max-width) {
207+
margin-left: -2rem;
208+
margin-right: -2rem;
209+
padding-left: 1rem;
210+
padding-right: 2rem;
211+
border-radius: 0;
212+
}
213+
200214
code {
201215
padding: 0;
202216
margin: 0;
203217
background: none;
204218
white-space: pre;
219+
line-height: 1;
205220
}
206221
}
207222

@@ -323,13 +338,15 @@ ol ol {
323338
justify-content: center;
324339
flex-direction: column;
325340
padding: .5rem 5rem;
341+
padding-top: 0rem;
326342
padding-bottom: 5rem;
327343
max-width: 60rem;
328344
min-height: calc(100vh - 6rem);
329345
margin: 0 auto;
330346

331347
@media (max-width: $phone-max-width) {
332-
padding: 2rem;
348+
padding: 1.5rem;
349+
padding-top: 0rem;
333350
}
334351
}
335352

sass/post.scss

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
h2 {
88
line-height: 1;
99
margin-left: -0.3rem;
10-
font-size: 4rem;
10+
padding-bottom: 0.5rem;
11+
font-size: 2rem;
1112
margin: 0;
12-
color: var(--background);
13-
opacity: 0.3;
13+
opacity: 0.5;
1414
line-height: 0.8;
15-
-webkit-text-stroke: 1px var(--color);
15+
font-family: "Linux Libertine Display";
1616
}
1717
}
1818

@@ -37,7 +37,7 @@ ul.toc {
3737
width: 100%;
3838
text-align: left;
3939
padding: 20px 0;
40-
40+
margin-bottom: 2rem;
4141

4242
// @media (max-width: $tablet-max-width) {
4343
// max-width: 660px;
@@ -48,9 +48,10 @@ ul.toc {
4848
}
4949

5050
%meta {
51-
font-size: 1rem;
51+
font-size: 1.2em;
5252
margin-bottom: 10px;
5353
color: var(--color);
54+
opacity: 0.8;
5455
}
5556

5657
&-meta {
@@ -69,8 +70,9 @@ ul.toc {
6970

7071
&-title {
7172
position: relative;
72-
font-size: 2rem;
73+
font-size: 1.7rem;
7374
margin: 0;
75+
margin-bottom: 0.5rem;
7476
font-weight: 600;
7577

7678
a {
@@ -91,9 +93,14 @@ ul.toc {
9193

9294
&-tags-inline {
9395
@extend %tags;
94-
95-
margin-left: 0.5rem;
96-
display: inline;
96+
display: block;
97+
98+
> a {
99+
opacity: 0.7;
100+
&:hover {
101+
opacity: 1;
102+
}
103+
}
97104

98105
@media (max-width: $phone-max-width) {
99106
display: block;

templates/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
coding!
5050
<br />
5151
<br /> #}
52-
<br>
53-
5452

5553
{% set section = get_section(path="_index.md") %}
5654

0 commit comments

Comments
 (0)