Skip to content

Commit 4f35560

Browse files
committed
Improve the inline codeblock styles
Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>
1 parent 04c6235 commit 4f35560

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

sass/_base.scss

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
$color-code-background: #272822;
2+
$color-code-color: #f8f8f2;
3+
14
:root {
25
--page-max-width: 57rem;
36
--page-with-toc-max-width: 81rem;
@@ -117,9 +120,10 @@ ol:last-child {
117120
}
118121

119122
pre {
123+
background-color: $color-code-background;
120124
padding: 1rem;
121125
overflow: auto;
122-
border-radius: 4px;
126+
border-radius: 0.3rem;
123127
}
124128

125129
// The line numbers already provide some kind of left/right padding
@@ -206,15 +210,31 @@ pre table {
206210
}
207211
}
208212

209-
:not(pre)>code {
210-
color: #f54029;
211-
border: 1px solid #f54029;
212-
border-radius: 4px;
213-
padding: 0 .4rem;
213+
code {
214+
background-color: $color-code-background;
215+
color: $color-code-color;
216+
border-radius: 0.3rem;
217+
padding: 1px 5px 2px;
218+
font-size: 0.8em;
219+
white-space: nowrap;
220+
}
221+
222+
h1, h2, h3, h4, h5, h6 {
223+
code {
224+
font-size: 0.75em;
225+
padding-top: 0;
226+
}
227+
}
228+
229+
pre code {
230+
white-space: inherit;
231+
font-size: inherit;
232+
padding: 0;
233+
background-color: transparent;
234+
border-radius: 0;
214235
}
215236

216237
a>code {
217-
border-color: var(--color-link);
218238
color: var(--color-link);
219239
}
220240

0 commit comments

Comments
 (0)