Skip to content

Commit c0b489f

Browse files
committed
small design changes
1 parent 252a73b commit c0b489f

File tree

4 files changed

+54
-46
lines changed

4 files changed

+54
-46
lines changed

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default defineConfig({
1414
markdown: {
1515
shikiConfig: {
1616
themes: {
17+
// NOTE: The base colors of these are additionally hardcoded in the global css
1718
light: 'github-light-high-contrast',
1819
dark: 'github-dark-high-contrast'
1920
},

src/components/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const today = new Date();
1616

1717
<p><em>
1818
<a href="/rss.xml" target="_blank">RSS Feed</a>,
19-
Built with <a href="https://www.11ty.dev/" target="_blank">{ Astro.generator }</a>,
19+
Built with <a href="https://astro.build/" target="_blank">{ Astro.generator }</a>,
2020
Commit: <a href={`${packageInfo.repository.url}/commit/${hash}`} target="_blank">{ hash }</a>
2121
</em></p>
2222
</footer>

src/content/blog/2021-12-13-cheap-and-stupid-aws-url-shortener/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ We have now resolved the question on how to redirect, but we also need to decide
6868

6969
*Which encoding?* The encoding everybody uses to encode anything on the web into a safe string. **Base64**. This means, we can map our requests like this:
7070

71-
| Requested URL | Filename |
72-
|-|-|
73-
| `example.org/abc123/welt` | `ZXhhbXBsZS5vcmcvYWJjMTIzL3dlbHQK.html` |
74-
| `something.example.org` | `c29tZXRoaW5nLmV4YW1wbGUub3JnCg==.html` |
71+
```md filename="request_url->filename"
72+
example.org/abc123/welt -> ZXhhbXBsZS5vcmcvYWJjMTIzL3dlbHQK.html
73+
something.example.org -> c29tZXRoaW5nLmV4YW1wbGUub3JnCg==.html
74+
```
7575

7676
### Handling traffic
7777

src/styles/global.css

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,49 @@
3838
}
3939
}
4040

41-
42-
/* Global stylesheet */
41+
/* Modern reset, source: https://www.joshwcomeau.com/css/custom-css-reset/ */
42+
/* 1. Use a more-intuitive box-sizing model */
43+
*, *::before, *::after {
44+
box-sizing: border-box;
45+
}
46+
/* 2. Remove default margin */
4347
* {
44-
box-sizing: border-box;
48+
/*margin: 0;*/
49+
}
50+
/* 3. Enable keyword animations */
51+
@media (prefers-reduced-motion: no-preference) {
52+
html {
53+
interpolate-size: allow-keywords;
54+
}
55+
}
56+
body {
57+
/* 4. Add accessible line-height */
58+
line-height: 1.5;
59+
/* 5. Improve text rendering */
60+
-webkit-font-smoothing: antialiased;
61+
}
62+
/* 6. Improve media defaults */
63+
img, picture, video, canvas, svg {
64+
display: block;
65+
max-width: 100%;
4566
}
67+
/* 7. Inherit fonts for form controls */
68+
input, button, textarea, select {
69+
font: inherit;
70+
}
71+
/* 8. Avoid text overflows */
72+
p, h1, h2, h3, h4, h5, h6 {
73+
overflow-wrap: break-word;
74+
}
75+
/* 9. Improve line wrapping */
76+
p {
77+
text-wrap: pretty;
78+
}
79+
h1, h2, h3, h4, h5, h6 {
80+
text-wrap: balance;
81+
}
82+
83+
/* Global stylesheet */
4684

4785
@view-transition {
4886
navigation: auto;
@@ -339,6 +377,7 @@ blockquote {
339377
padding: 15px 10px;
340378
margin: 20px auto;
341379
border-left: 5px solid var(--text-color-link);
380+
background-color: var(--background-color);
342381
}
343382

344383
/* See https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/Heading_Elements#specifying_a_uniform_font_size_for_h1 */
@@ -350,15 +389,15 @@ article h1 {
350389
/* Code stuff */
351390
.astro-code {
352391
font-family: var(--font-family-monospace);
353-
font-size: 1rem;
392+
font-size: 0.85rem;
354393
margin: 20px 0;
355394
overflow-x: hidden;
356395
padding: 0;
357396
border: 2px solid var(--background-color);
358397
}
359398

360399
.astro-code pre {
361-
overflow-x: scroll;
400+
overflow-x: auto;
362401
padding: .75rem;
363402
margin: 0;
364403
}
@@ -367,16 +406,17 @@ code:not(pre code) {
367406
white-space: pre-wrap !important;
368407
word-break: break-all !important;
369408

370-
padding: 0.5em 0.5em .3em 0.5em;
409+
padding: .2em .5em;
371410
color: var(--shiki);
372411
border: 1px solid var(--background-color);
373412
border-radius: 4px;
374413
background-color: var(--shiki-bg);
375414

376415
hyphens: none;
377416
tab-size: var(--syntax-tab-size);
378-
vertical-align:bottom;
379-
font-size: inherit;
417+
vertical-align:baseline;
418+
font-family: var(--font-family-monospace);
419+
font-size: 0.85rem;
380420
line-height: inherit;
381421
}
382422

@@ -424,37 +464,4 @@ code:not(pre code) {
424464

425465
.footnotes a {
426466
word-break: break-all;
427-
}
428-
429-
/* Minimal Modern Responsive CSS Table */
430-
table {
431-
width: 100%;
432-
border-collapse: collapse;
433-
border-spacing: 0;
434-
text-indent: 0;
435-
margin: 1rem 0;
436-
437-
overflow-x: scroll;
438-
border: 1px solid var(--text-color);
439-
/* border-radius: 0.3rem; */
440-
}
441-
442-
table th,
443-
table td {
444-
padding: 0.75rem 1rem;
445-
text-align: left;
446-
}
447-
448-
table thead {
449-
background: var(--text-color);
450-
color: var(--background-color);
451-
font-weight: bolder;
452-
}
453-
454-
table tr {
455-
border-bottom: 1px solid #eee;
456-
}
457-
458-
table tr:last-child {
459-
border-bottom: none;
460467
}

0 commit comments

Comments
 (0)