Skip to content

Commit 75597ff

Browse files
committed
attempt to fix brand without changing distributions
1 parent 29e13a5 commit 75597ff

File tree

6 files changed

+36
-17
lines changed

6 files changed

+36
-17
lines changed

src/format/reveal/format-reveal-theme.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818

1919
import { isFileRef } from "../../core/http.ts";
2020
import { pathWithForwardSlashes } from "../../core/path.ts";
21-
import { formatResourcePath } from "../../core/resources.ts";
21+
import { formatResourcePath, resourcePath } from "../../core/resources.ts";
2222
import {
2323
cleanSourceMappingUrl,
2424
compileSass,
@@ -164,6 +164,7 @@ export async function revealTheme(
164164
const quartoLayers = [
165165
quartoBaseLayer(format, true, true, false, true),
166166
quartoLayer(),
167+
quartoRevealBrandLayer(),
167168
];
168169
const titleSlideLayer = titleSlideScss(format);
169170
if (titleSlideLayer) {
@@ -284,3 +285,9 @@ function quartoLayer(): SassLayer {
284285
function themeLayer(theme: string): SassLayer {
285286
return sassLayerFile(theme);
286287
}
288+
289+
function quartoRevealBrandLayer(): SassLayer {
290+
return sassLayerFile(
291+
resourcePath(join("formats", "revealjs", "brand", "brand.scss")),
292+
);
293+
}

src/resources/formats/html/bootstrap/_bootstrap-variables.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,13 @@ $table-group-separator-color-lighter: lighten(
244244

245245
$bootstrap-version: 5;
246246

247-
$h1h2h3-font-weight: 600 !default;
247+
$h1h2h3-font-weight: 600 !default;
248+
249+
// variables required by _brand.yml
250+
$font-family-monospace-block: $font-family-monospace !default;
251+
$font-family-monospace-inline: $font-family-monospace !default;
252+
$font-weight-monospace: $font-weight-base !default;
253+
$font-weight-monospace-block: $font-weight-monospace !default;
254+
$font-weight-monospace-inline: $font-weight-monospace !default;
255+
$code-block-font-size: $code-font-size !default;
256+
$code-inline-font-size: $code-font-size !default;

src/resources/formats/html/bootstrap/dist/scss/_variables.scss

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,7 @@ $offcanvas-backdrop-opacity: $modal-backdrop-opacity !default;
17561756
// scss-docs-end offcanvas-variables
17571757

17581758
// Code
1759+
17591760
$code-font-size: $small-font-size !default;
17601761
// Amount intentionally matches mixture amount of shiny::inputPanel()
17611762
// https://github.com/rstudio/shiny/blob/4eeb4a1/inst/www/shared/shiny_scss/bootstrap.scss#L25
@@ -1772,13 +1773,4 @@ $nested-kbd-font-weight: null !default; // Deprecated in v5.2.0, remo
17721773

17731774
$pre-bg: $code-bg !default;
17741775
$pre-color: $body-emphasis-color !default;
1775-
$pre-line-height: $line-height-base !default;
1776-
1777-
// variables required by _brand.yml
1778-
$font-family-monospace-block: $font-family-monospace !default;
1779-
$font-family-monospace-inline: $font-family-monospace !default;
1780-
$font-weight-monospace: $font-weight-base !default;
1781-
$font-weight-monospace-block: $font-weight-monospace !default;
1782-
$font-weight-monospace-inline: $font-weight-monospace !default;
1783-
$code-block-font-size: $code-font-size !default;
1784-
$code-inline-font-size: $code-font-size !default;
1776+
$pre-line-height: $line-height-base !default;

src/resources/formats/revealjs/quarto.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,3 +812,16 @@ kbd {
812812
border-radius: 5px;
813813
padding: $kbd-padding-y $kbd-padding-x;
814814
}
815+
816+
:root {
817+
--r-inline-code-font: #{$inlineCodeFont};
818+
--r-block-code-font: #{$blockCodeFont};
819+
}
820+
821+
.reveal code {
822+
font-family: var(--r-inline-code-font);
823+
}
824+
825+
.reveal pre code {
826+
font-family: var(--r-block-code-font);
827+
}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
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 */
2523
--r-link-color: #{$linkColor};
26-
--r-link-color-dark: #{darken($linkColor, 15%)};
24+
--r-link-color-dark: #{darken($linkColor , 15% )};
2725
--r-link-color-hover: #{$linkColorHover};
2826
--r-selection-background-color: #{$selectionBackgroundColor};
2927
--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,6 +174,7 @@
174174

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

179180
word-wrap: break-word;
@@ -182,13 +183,12 @@
182183
}
183184

184185
.reveal code {
185-
font-family: var(--r-inline-code-font);
186+
font-family: var(--r-code-font);
186187
text-transform: none;
187188
tab-size: 2;
188189
}
189190

190191
.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)