Skip to content

Commit

Permalink
Expose CSS property for code span font size
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Aug 18, 2024
1 parent 22b75d0 commit 12b58e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 8 additions & 3 deletions core/src/main/resources/render/theme/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
--qd-main-font: inherit;
--qd-main-font-size: 1em;
--qd-code-font: monospace;
--qd-code-font-size: var(--qd-main-font-size);
--qd-code-block-font-size: var(--qd-main-font-size);
--qd-code-span-font-size: var(--qd-main-font-size);
--qd-heading-font: inherit;
--qd-block-margin: 32px;
--qd-box-margin-multiplier: 1.5; /* --qd-block-margin * this = box vertical margin */
Expand Down Expand Up @@ -66,11 +67,15 @@ ul, ol, hr,
}

code {
font-family: var(--qd-font);
font-family: var(--qd-code-font);
}

code:not(pre code) {
font-size: var(--qd-code-span-font-size);
}

pre code {
font-size: var(--qd-code-font-size);
font-size: var(--qd-code-block-font-size);
max-height: none !important;
}

Expand Down
5 changes: 5 additions & 0 deletions core/src/main/resources/render/theme/layout/beamer.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
--qd-heading-font: "Fira Sans", sans-serif;
--qd-code-font: "Noto Sans Mono", monospace;
--qd-code-font-size: 1.25em;
--qd-code-span-font-size: 0.9em;
--qd-block-margin: 32px;
--qd-box-margin-multiplier: 1.2;
}
Expand Down Expand Up @@ -84,6 +85,10 @@ pre code {
padding-left: 4px;
}

.codespan-content {
margin: 0 0.2em;
}

.color-preview {
margin: 0 0.2em;
border-radius: 100%;
Expand Down
7 changes: 2 additions & 5 deletions core/src/main/resources/render/theme/layout/minimal.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
--qd-main-font: "Lato", sans-serif;
--qd-heading-font: "Inter", sans-serif;
--qd-code-font: "Noto Sans Mono", monospace;
--qd-code-font-size: 1.3em;
--qd-code-block-font-size: 1.3em;
--qd-code-span-font-size: 0.9em;
--qd-block-margin: 1.8em;
--qd-line-height: 1.8;
}
Expand Down Expand Up @@ -94,10 +95,6 @@ figure figcaption {
border-radius: 8px 8px 0 0;
}

p code {
font-size: 0.9em;
}

.error-box code {
font-size: 0.7em;
}
Expand Down

0 comments on commit 12b58e3

Please sign in to comment.