Skip to content

Commit 29e13a5

Browse files
committed
revealjs,brand - support for font family size and customization for monospace{,-inline,-block}
1 parent 73ad83c commit 29e13a5

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

src/core/sass/brand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,14 @@ const brandTypographyBundle = (
355355
["size", "code-font-size"],
356356
// forward explicitly to both `code` and `pre`
357357
// because that interacts less with the default bootstrap styles
358-
["color", "code-color"],
358+
["color", "code-color"], // this is also revealjs
359359
["color", "pre-color"],
360360

361361
["weight", "font-weight-monospace"],
362362

363363
// revealjs
364364
["size", "code-block-font-size"],
365+
["color", "code-block-color"],
365366
],
366367
"monospace-block": [
367368
// bootstrap + revealjs

src/resources/formats/revealjs/quarto.scss

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ $presentation-font-size-root: 40px !default;
1313
$presentation-font-smaller: 0.7 !default;
1414
$presentation-line-height: 1.3 !default;
1515

16+
// Default variables which exist in bootstrap themes
17+
// and are here to simplify the implementation of _brand.yml and
18+
// user theming customization in general
19+
$font-weight-base: 400 !default;
20+
$code-font-size: $presentation-font-size-root !default;
21+
$font-family-monospace-block: $font-family-monospace !default;
22+
$font-family-monospace-inline: $font-family-monospace !default;
23+
1624
// main colors
1725
$body-bg: #fff !default;
1826
$body-color: #222 !default;
@@ -66,10 +74,11 @@ $presentation-list-bullet-color: $body-color !default;
6674
// code blocks
6775
$code-block-bg: $body-bg !default;
6876
$code-block-border-color: lighten($body-color, 60%) !default;
69-
$code-block-font-size: 0.55em !default;
77+
$code-block-font-size: ($code-font-size * 0.55) !default;
7078
$code-block-height: 500px !default;
7179
$code-block-theme-dark-threshhold: 40% !default;
7280
$code-block-line-height: $presentation-line-height !default;
81+
$code-block-color: $body-color !default;
7382

7483
// inline code
7584
$code-color: var(--quarto-hl-fu-color) !default;
@@ -146,6 +155,8 @@ $heading3Size: $revealjs-h3-font-size !default;
146155
$heading4Size: $revealjs-h4-font-size !default;
147156

148157
$codeFont: $font-family-monospace !default;
158+
$inlineCodeFont: $font-family-monospace-inline !default;
159+
$blockCodeFont: $font-family-monospace-block !default;
149160

150161
// Links and actions
151162
$linkColor: $link-color !default;
@@ -169,19 +180,12 @@ $kbd-font-size: $presentation-font-size-root !default;
169180
$kbd-color: $body-color !default;
170181
$kbd-bg: $gray-100 !default; // like in bootstrap style
171182

172-
// Default variables which exist in bootstrap themes
173-
// and are here to simplify the implementation of _brand.yml and
174-
// user theming customization in general
175-
$font-weight-base: 400 !default;
176-
$code-font-size: $presentation-font-size-root !default;
177-
178183
// variables required by _brand.yml
179184
$font-family-monospace-block: $font-family-monospace !default;
180185
$font-family-monospace-inline: $font-family-monospace !default;
181186
$font-weight-monospace: $font-weight-base !default;
182187
$font-weight-monospace-block: $font-weight-monospace !default;
183188
$font-weight-monospace-inline: $font-weight-monospace !default;
184-
$code-block-font-size: $code-font-size !default;
185189
$code-inline-font-size: $code-font-size !default;
186190

187191
/*-- scss:functions --*/
@@ -318,6 +322,7 @@ div.reveal div.slides section.quarto-title-block {
318322

319323
.reveal code {
320324
color: $code-color;
325+
font-size: $code-inline-font-size;
321326
background-color: $code-bg;
322327
white-space: pre-wrap;
323328
}
@@ -334,7 +339,8 @@ div.reveal div.slides section.quarto-title-block {
334339

335340
.reveal pre code {
336341
background-color: $body-bg;
337-
color: $body-color;
342+
font-size: $code-block-font-size;
343+
color: $code-block-color;
338344
}
339345

340346
.reveal .column-output-location {

src/resources/formats/revealjs/reveal/css/theme/template/exposer.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
--r-heading3-size: #{$heading3Size};
2121
--r-heading4-size: #{$heading4Size};
2222
--r-code-font: #{$codeFont};
23+
--r-inline-code-font: #{$inlineCodeFont}; /* quarto-specific */
24+
--r-block-code-font: #{$blockCodeFont}; /* quarto-specific */
2325
--r-link-color: #{$linkColor};
24-
--r-link-color-dark: #{darken($linkColor , 15% )};
26+
--r-link-color-dark: #{darken($linkColor, 15%)};
2527
--r-link-color-hover: #{$linkColorHover};
2628
--r-selection-background-color: #{$selectionBackgroundColor};
2729
--r-selection-color: #{$selectionColor};

src/resources/formats/revealjs/reveal/css/theme/template/theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174

175175
text-align: left;
176176
font-size: 0.55em;
177-
font-family: var(--r-code-font);
178177
line-height: 1.2em;
179178

180179
word-wrap: break-word;
@@ -183,12 +182,13 @@
183182
}
184183

185184
.reveal code {
186-
font-family: var(--r-code-font);
185+
font-family: var(--r-inline-code-font);
187186
text-transform: none;
188187
tab-size: 2;
189188
}
190189

191190
.reveal pre code {
191+
font-family: var(--r-block-code-font);
192192
display: block;
193193
padding: 5px;
194194
overflow: auto;

0 commit comments

Comments
 (0)