Commit 5b46b50
fix(revealjs): load default-theme Source Sans Pro via Google Fonts @import
The compiled Quarto reveal theme named `Source Sans Pro` in `--r-main-font` but
loaded no font face, so `q2 render` fell back to Helvetica on any machine
without Source Sans Pro installed — while `q2 preview` showed Source Sans Pro
(reveal's vendored white.css embeds it as a base64 @font-face). Surfaced in
end-to-end testing as "render points to the wrong fonts."
Fix per user decision: load Source Sans Pro from the Google Fonts CDN with a
foundry `@import` in the Quarto reveal layer's `scss:defaults`, mirroring the
named themes (Lato/Ubuntu/…) and Quarto 1's `_brand.yml` font model — rather
than bundling the font binaries. The render is intentionally not self-contained
for fonts, matching Quarto 1's import-based approach. A theme or `_brand.yml`
that sets a different `$font-family-sans-serif` supplies its own font and this
import is then unused (harmless), exactly as in Quarto 1's quarto.scss.
Sass hoists the CSS `@import url(...)` to the top of the compiled output (CSS
requires `@import` first); a test asserts both the import's presence and that it
precedes the first `.reveal` rule. E2E: `q2 render` + Chrome confirmed the
Source Sans Pro 400 face loads and applies.
Note: this fixes the render side only. The preview still shows reveal's stock
white.css look (centered text, uppercase headings, its own SSP) because the
q2-slides preview never applies the compiled Quarto reveal theme — full
per-document preview parity is the larger follow-up (bd-y259zb57, Level 2).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ff31c8e commit 5b46b50
2 files changed
Lines changed: 31 additions & 0 deletions
File tree
- crates/quarto-sass/tests/integration
- resources/scss/revealjs
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
89 | 109 | | |
90 | 110 | | |
91 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
12 | 23 | | |
13 | 24 | | |
14 | 25 | | |
| |||
0 commit comments