Theme compilation fails when a theme declares `$body-bg` or `$body-color` as `null`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- sass, scss
- Domínio
- build-system
Direção de pesquisa
Comece por src/resources/formats/html/bootstrap/_bootstrap-variables.scss, nos dois testes vinculados na issue, e compare-os com o teste de null existente para pre-color. Reproduza o problema com os exemplos fornecidos custom.scss e index.qmd, usando quarto render index.qmd. O trabalho estará concluído quando temas que declaram $body-bg ou $body-color como null forem renderizados com os valores alternativos documentados.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I have:
- searched the issue tracker for similar issues
- installed the latest version of Quarto CLI
- formatted my issue following the Bug Reports guide
Bug description
Quarto's Bootstrap variables test variable-exists(body-bg) and variable-exists(body-color) to decide whether a theme has set them.
variable-exists() is true for a variable that holds null, so a theme that declares $body-bg: null !default; makes $body-contrast-bg null, and compilation stops.
The pre-color check a few lines above already handles this case with variable-exists(pre-color) and $pre-color != null:
A null declaration at the root is what Dart Sass itself recommends.
A theme that sets $body-bg only under some condition has to declare it first, or use !global inside the @if, which Dart Sass flags as deprecated:
DEPRECATION WARNING [new-global]: As of Dart Sass 2.0.0, !global assignments won't be able to declare new variables.
Recommendation: add `$body-bg: null` at the stylesheet root.
Following that advice breaks the render, so the theme is stuck with the deprecation.
I also tried $primary: null !default;, and that one renders.
Steps to reproduce
custom.scss:
/*-- scss:defaults --*/
$body-bg: null !default;
index.qmd:
---
title: "Null body-bg"
format:
html:
theme: [default, custom.scss]
---
Hello.
Run quarto render index.qmd.
Replace $body-bg with $body-color for the second error.
Actual behavior
With $body-bg: null !default;:
ERROR: Theme file compilation failed:
Error: $color: null is not a color.
╷
827 │ $red: _linear-channel-value(quarto-color.red($color));
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
... 827:31 luminance()
... 837:13 quarto-contrast()
... 854:19 tone()
... 508:7 theme-contrast()
With $body-color: null !default; and the default theme:
Error: $color1: null is not a color.
Expected behavior
A null value counts as "not set", as it already does for $pre-color.
Quarto falls back to $white and $gray-900, and the document renders.
Your environment
- IDE: none, command line.
- OS: macOS 27.2.
Quarto check output
Reproduced with a development build of main at 089ba530b.
The two lines above are the same at the v1.11.9 tag.
Quarto 99.9.9
[✓] Checking environment information...
Quarto cache location: /Users/mcanouil/Library/Caches/quarto
Project: none found (single-file mode)
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.107.1: OK
Deno version 2.9.8: OK
Typst version 0.15.1: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 089ba530b3ed4ec156a355d41b6b7de2db3e44ea
Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin
[✓] Checking tools....................OK
TinyTeX: v2026.07
Chrome Headless Shell: (not installed)
VeraPDF: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
Version: 2026
[✓] Checking Chrome Headless....................OK
Using: Chrome from QUARTO_CHROMIUM
Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
[✓] Checking basic markdown render....OK
- Linguagem predominante
- JavaScript
- Estrelas
- 6.1k
- Forks
- 478
- Merge médio
- 17h 58min
- PRs com merge (30d)
- 135
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de quarto-dev/quarto-cli
-
brand bug typst
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
quarto-dev/quarto-cli#15311 ·
Mantenedores costumam responder em até 1 dia
-
Notebook preview header title takes the heading colour on the primary backgroundTalvez já em andamento @SabyaXSachi assumiu há 1 dia. Abertaaccessibility bug embed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
quarto-dev/quarto-cli#15306 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
accessibility bug code-blocks html themes
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
quarto-dev/quarto-cli#15303 ·
Mantenedores costumam responder em até 1 dia
-
accessibility brand bug dark-mode
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
quarto-dev/quarto-cli#15301 ·
Mantenedores costumam responder em até 1 dia
-
bootstrap bug html tables
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
quarto-dev/quarto-cli#15300 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de quarto-dev/quarto-cli
Issues semelhantes
-
Add: ESP 2 RSAbertaapproved check:passed feeds:add
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 67/100
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceAbertabug 🐛
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
comunica/comunica#1960 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Waiting for: Product Owner
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
getsentry/sentry-javascript#26203 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia