Skip to content

Conversation

cscheid
Copy link
Collaborator

@cscheid cscheid commented Oct 10, 2024

Towards #10249

This adds configuration of weight + color to fonts, and fine-grained control of weight + color + family to all fonts (including distinguishing between monospace, monospace-inline and monospace-block).

@cscheid
Copy link
Collaborator Author

cscheid commented Oct 10, 2024

The tests are failing because this interacts with revealjs, so I'm going to have to do these and the revealjs in the same PR.

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each time we modify something in _quarto-rules.scss, we need to make sure this is also working without bootstrap.

In this PR, some new variables are used in _quarto-rules.scss and so they need to be defined either in _quarto-variables.scss or quartoDefault if the variable is dependent of a metadata for example.

_quarto-variables.scss will always be added as a default layers, bootstrap or not. So it could be used for anything that should be availabel always.

Not that it is a problem with revealjs because that is our only HTML format not using Bootstrap. But the issue is really with no bootstrap, so the issue can be reproduce using html format without bootstrap.

---
title: "Untitled"
format: 
  html:
    theme: pandoc
---

Test
==> quarto preview index.qmd --to html --no-watch-inputs --no-browse

Warning: variable used before declaration
variable:  link-color 95
ERROR: Theme file compilation failed:

Error: Undefined variable.
    ╷
478 │   font-family: $font-family-monospace-block;
    │                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵

Stack trace:

Error: Undefined variable.
    ╷
478 │   font-family: $font-family-monospace-block;
    │                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
    at dartCommand (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/core/dart-sass.ts:101:11)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async dartCompile (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/core/dart-sass.ts:51:3)
    at async SassCache.setFromHash (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/core/sass/cache.ts:89:7)
    at async compileSass (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/core/sass.ts:153:18)
    at async resolveSassBundles (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/command/render/pandoc-html.ts:131:17)
    at async resolveExtras (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/command/render/pandoc.ts:1303:14)
    at async runPandoc (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/command/render/pandoc.ts:420:20)
    at async renderPandoc (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/command/render/render.ts:202:24)
    at async Object.onRender (file:///C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/command/render/render-files.ts:715:30)

Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. It feels a lot cleaner not modifying distribution file.

@cscheid cscheid merged commit e59b35c into main Oct 17, 2024
6 checks passed
@cscheid cscheid deleted the feature/brand-yaml-html-monospace-fixes branch October 17, 2024 15:47
cderv added a commit that referenced this pull request Oct 25, 2024
This follows up on #11028 to do it differently in similar manner as in `_reboot.scss` so that code inside pre does not apply font-size a second time
cderv added a commit that referenced this pull request Oct 28, 2024
This follows up on #11028 to do it differently in similar manner as in `_reboot.scss` so that code inside pre does not apply font-size a second time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants