Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions sass/_base.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
$color-code-background: #272822;
$color-code-color: #f8f8f2;

:root {
--page-max-width: 57rem;
--page-with-toc-max-width: 81rem;
Expand Down Expand Up @@ -117,9 +120,10 @@ ol:last-child {
}

pre {
background-color: $color-code-background;
padding: 1rem;
overflow: auto;
border-radius: 4px;
border-radius: 0.3rem;
}

// The line numbers already provide some kind of left/right padding
Expand Down Expand Up @@ -206,15 +210,31 @@ pre table {
}
}

:not(pre)>code {
color: #f54029;
border: 1px solid #f54029;
border-radius: 4px;
padding: 0 .4rem;
code {
background-color: $color-code-background;
color: $color-code-color;
border-radius: 0.3rem;
padding: 1px 5px 2px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to talk about units in general. If you use absolute units for the paddings and relative units for the font size, then people with other base font sizes will have misaligned code blocks.

font-size: 0.8em;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
font-size: 0.8em;

I don't think we need to decrease the size of the text. Keeping it the same size ensures consistency, which I believe is something we should strive for in this situation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason here is that with all the border and background it always felt larger than the rest. Hence this tried to visually match the surroundings. But maybe thats just me

@weeman1337 weeman1337 Mar 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this one is subjective. For me the .8 makes inline code hard(er) to read in text blocks because the font size changes in the flow.

white-space: nowrap;
}

h1, h2, h3, h4, h5, h6 {
code {
font-size: 0.75em;
padding-top: 0;
}
}

pre code {
white-space: inherit;
font-size: inherit;
padding: 0;
background-color: transparent;
border-radius: 0;
}

a>code {
border-color: var(--color-link);
color: var(--color-link);
}

Expand Down