Website projects ignore `$border-color` and `$border-radius` defaults because of an invalid `scss:variables` boundary in `quarto-listing.scss`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- sass
- Domain
- build-system
Research direction
Read src/core/sass.ts around lines 201–202 and inspect src/resources/projects/website/listing/quarto-listing.scss around lines 4 and 80–98. Confirm how the layer parser handles the scss:variables boundary, then render the provided website reproduction and compare its CSS with the standalone output. Done when the website honors the theme's $border-color and $border-radius defaults.
Written by the indexing model from the issue text.
Description
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
In a website project, a theme that sets $border-color or $border-radius with !default in scss:defaults has no effect.
The same theme works in a standalone document.
Colours and radii that a theme sets for borders, form controls and cards are replaced by Quarto's own values.
quarto-listing.scss starts the functions layer with a valid boundary.
A later line is /*-- scss:variables --*/, followed by variables such as $border-color: $gray-300 !default; and $border-radius: 0.25rem !default;.
The layer parser only accepts uses, functions, rules, defaults and mixins, so variables is read as a comment.
Those variables therefore stay in the functions layer.
Functions are written before all defaults, so they are set first, and the !default of a theme or user layer that comes later is ignored.
With QUARTO_SAVE_SCSS set, the saved file shows the order.
$border-color: $gray-300 !default; is at line 620, inside the 'functions' section from Quarto (lines 490 to 1036).
The theme's $border-color: #ff0000 !default; is at line 1042, under Defaults from user-defined SCSS.
#13960 reports the same kind of bad delimiter for title-block.scss, where the variables are all null !default and nothing breaks.
This file is different, because its variables shadow real theme variables.
Steps to reproduce
custom.scss:
/*-- scss:defaults --*/
$border-color: #ff0000 !default;
$border-radius: 1rem !default;
_quarto.yml of a website project:
project:
type: website
website:
title: t
format:
html:
theme: [default, custom.scss]
index.qmd is any page with a title.
For comparison, render a standalone document with the same theme: [default, custom.scss].
quarto render
grep -o -- '--bs-border-color:[^;]*' _site/site_libs/bootstrap/bootstrap-*.min.css
grep -o -- '\.form-control{[^}]*}' _site/site_libs/bootstrap/bootstrap-*.min.css | grep -o 'border-radius:[^;]*'
Actual behavior
| Output | --bs-border-color |
.form-control border-radius |
|---|---|---|
| website project | #dee2e6 |
.25rem |
| standalone document | #ff0000 |
1rem |
Rendered in a website project, the form control and the button keep Quarto's .25rem radius and the grey border:
The same theme in a standalone document:
Expected behavior
The !default values of the theme apply in a website project, as they do in a standalone document.
Your environment
- IDE: none, terminal only
- OS: macOS (Darwin 27.0.0, Apple Silicon)
Quarto check output
Quarto 99.9.9
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.10.0: OK
Dart Sass version 1.101.0: OK
Deno version 2.7.14: OK
Typst version 0.15.1: OK
[✓] Checking Quarto installation......OK
Version: 99.9.9
commit: 69592e5c1718d3e1b2f3d11e757d32e23a16af67
- Dominant language
- JavaScript
- Stars
- 6.1k
- Forks
- 471
- Avg merge
- 17h 35m
- Merged PRs (30d)
- 107
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto-cli
-
accessibility bug html websites
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
quarto-dev/quarto-cli#15187 ·
Maintainers usually reply within 1 day
-
enhancement themes websites
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
quarto-dev/quarto-cli#15179 ·
Maintainers usually reply within 1 day
-
about-page bug layout websites
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
quarto-dev/quarto-cli#15178 ·
Maintainers usually reply within 1 day
-
a11y: prev/next page links and title breadcrumbs use `$text-muted` and fail contrast on dark themesOpenaccessibility bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
quarto-dev/quarto-cli#15175 ·
Maintainers usually reply within 1 day
-
accessibility bug code-blocks
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
quarto-dev/quarto-cli#15174 ·
Maintainers usually reply within 1 day
All issues in quarto-dev/quarto-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
thedevs-network/kutt#1059 ·
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
0. Needs triage 35-feedback bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day