Skip to content

Commit c710f8d

Browse files
committed
fix: codeblock top padding default no overlap, darker inner blockquote,
bump up font-size to min of 16px
1 parent ac74f28 commit c710f8d

5 files changed

Lines changed: 39 additions & 36 deletions

File tree

content/code-example.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on this article to see some code in action.
1414
<!-- more -->
1515

1616
```rust
17-
1817
fn main() {
1918
println!("Hello World");
2019
}
@@ -39,17 +38,14 @@ fn main() {
3938
Python example:
4039

4140
```python
42-
4341
def main():
4442
print("Hello, world!")
4543
```
4644

4745
This is another code block with syntax highlighting. It's pretty cool, right?
4846
You can also have inline code like this: `var example = true`.
4947

50-
<!-- prettier-ignore-->
5148
```js
52-
5349
function debounce(func, wait) {
5450
var timeout;
5551

content/latex-example.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ $$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
1313

1414
<!-- more -->
1515

16-
Some fancy math thingy:
16+
We can show LaTeX display math by using either the `\\[ ... \\]` or `$$ ... $$`
17+
environments:
1718

1819
$$
1920
\frac{d}{dx} \left( \int_{0}^{x} f(u) \, du \right) = f(x)
2021
$$
2122

22-
$$
23-
\frac{d}{dx} \left( \int_{g(x)}^{h(x)} f(u) \, du \right) = f(h(x)) h'(x) -
23+
\\[
24+
\frac{d}{dx} \left( \int\_{g(x)}^{h(x)} f(u) \, du \right) = f(h(x)) h'(x) -
2425
f(g(x)) g'(x)
25-
$$
26-
27-
$$
28-
\texttt{Isn't that cool?!}
29-
$$
26+
\\]
3027

31-
---
28+
LaTeX can be written inline as well using the `\\( ... \\)` or `$ ... $`
29+
environments: $x = 25$ or \\(y = \pi\\)
3230

3331
## Another cool thingy
3432

content/markdown-demo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Some other footnote that is inline[^2]. As you can see, it just blends right in!
9696
## Code Blocks
9797

9898
```rust
99-
10099
fn main() {
101100
println!("Hello, world!");
102101
}

sass/_vendor.scss

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Vendor styles */
22
html {
3-
font-size: 12px
3+
font-size: clamp(16px, 1.2vw + 1px, 18px);
44
}
55

66
* {
@@ -15,7 +15,7 @@ body {
1515

1616
body {
1717
font-size: 1rem;
18-
line-height: 1.5rem;
18+
line-height: 1.6;
1919
margin: 0;
2020
font-family:
2121
'JetBrains Mono', Menlo, Monaco, Lucida Console, Liberation Mono,
@@ -48,14 +48,6 @@ pre {
4848
overflow: auto
4949
}
5050

51-
code[class*=language-],
52-
pre[class*=language-],
53-
pre code {
54-
font-weight: 100;
55-
text-shadow: none;
56-
margin: 1.75rem 0
57-
}
58-
5951
a {
6052
cursor: pointer;
6153
color: #ff2e88;
@@ -364,7 +356,7 @@ a {
364356
}
365357

366358
.hack blockquote {
367-
border-left: 0.15em solid var(--accent, #ff2e88);
359+
border-left: 0.2em solid var(--accent, #ff2e88);
368360
border-top-right-radius: 0.2em;
369361
border-bottom-right-radius: 0.2em;
370362
position: relative;
@@ -394,7 +386,6 @@ a {
394386
}
395387
}
396388

397-
398389
a {
399390
color: #FFE4EE;
400391
font-weight: normal;
@@ -417,6 +408,9 @@ a {
417408
.dark blockquote {
418409
background-color: #5E667F;
419410

411+
blockquote {
412+
background-color: #555c72;
413+
}
420414
}
421415

422416
.light blockquote {
@@ -430,6 +424,10 @@ a {
430424
code {
431425
background: #E8E6ED;
432426
}
427+
428+
blockquote {
429+
background-color: #dcd9df;
430+
}
433431
}
434432

435433
.hack blockquote:after {

sass/parts/_code.scss

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,17 @@ $language-colors: (
3737
$r: red($color);
3838
$g: green($color);
3939
$b: blue($color);
40-
$brightness: ($r * 0.299 + $g * 0.587 + $b * 0.114);
40+
$brightness: (
41+
$r * 0.299 + $g * 0.587 + $b * 0.114
42+
);
4143

42-
@if ($brightness > 128) {
43-
@return #000000; // Use black for bright backgrounds
44-
} @else {
45-
@return #ffffff; // Use white for dark backgrounds
46-
}
44+
@if ($brightness > 128) {
45+
@return #000000; // Use black for bright backgrounds
46+
}
47+
48+
@else {
49+
@return #ffffff; // Use white for dark backgrounds
50+
}
4751
}
4852

4953
// Mixin for language label styles
@@ -105,15 +109,15 @@ pre {
105109
border-radius: 5px;
106110
border: 1px solid var(--border-color);
107111
line-height: 1.4;
108-
padding: 1em;
109-
position: relative; // Make sure absolute elements like the label and button work
112+
padding-top: 1.8em;
113+
padding-bottom: 1em;
114+
position: relative;
110115
overflow-x: auto;
111116
-webkit-overflow-scrolling: touch;
112117

113118
code {
114119
background-color: transparent !important;
115120
color: inherit;
116-
font-size: 100%;
117121
border: none;
118122

119123
table td {
@@ -126,7 +130,6 @@ pre {
126130
color: #ffffff !important;
127131
}
128132

129-
130133
pre code table mark {
131134
color: unset;
132135
padding: 0;
@@ -157,3 +160,12 @@ code {
157160
color: var(--text-color);
158161
background-color: var(--bg-primary);
159162
}
163+
164+
code,
165+
pre,
166+
kbd,
167+
samp {
168+
font-size: 1.05em;
169+
/* slightly larger than the surrounding text */
170+
line-height: 1.6;
171+
}

0 commit comments

Comments
 (0)