Repository navigation
Treat a null $body-bg or $body-color as unset in Bootstrap variables - #15345
Open
SAMARTHJAISWAL wants to merge 1 commit into
Open
SAMARTHJAISWAL wants to merge 1 commit into
SAMARTHJAISWAL wants to merge 1 commit into
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
A theme that declares `$body-bg: null !default;` (as Dart Sass recommends before setting a variable conditionally) made `variable-exists()` true, so Quarto used the null value and theme compilation failed. Check for null too, as the `$pre-color` fallback already does. Fixes quarto-dev#15304
SAMARTHJAISWAL
force-pushed
the
fix/null-body-bg
branch
from
November 12, 2026 17:13
c84bd1d to
ade18cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #15304.
A theme that declares
$body-bg: null !default;or$body-color: null !default;broke theme compilation ($color: null is not a color). Dart Sass recommends that declaration before setting a variable conditionally.variable-exists()is true for a variable that holdsnull, so the Bootstrap variables used the null value instead of falling back.This adds
and $body-bg != null/and $body-color != nullto each of these checks, the same way the$pre-colorcheck already does. The checks are in_bootstrap-variables.scss,_bootstrap-functions.scss(morph, cyborg) and_quarto-variables-copy-code.scss. The two$popover-bg/$input-bgchecks fall back tonullanyway, so I left them unchanged. Bootstrap's own!defaultthen fills in the null variables, so the page gets Bootstrap's default body colours.Tested:
tests/docs/smoke-all/2026/11/12/issue-15304.qmd: fails onmainbecause the render errors, and passes with this change.dark-mode,brand/colorand earlier theme smoke tests locally. Everything that doesn't need R or Python passes (29). The 14 I couldn't run here need R or Jupyter, which aren't installed on my machine.cyborg,morphanddarklythemes, andcyborgwith the null override.Checklist
I have (if applicable):
AI-assisted PR