`title-block.scss` has bad layer delimiters

Open
#13,960 0 comments 0 reactions 1 assignee View on GitHub

@cscheid is already working on this.

Since Jan 26, 2026.

Assessment

This issue has not been assessed yet.

Description

bootstrap bug html themes

The hungry ghost spotted this problem while I was working on the Rust port:

⏺ The title block styles are now included in the compiled CSS.

  Now let me explain the TS Quarto bug I found regarding the layer boundary parsing:

  TS Quarto Layer Parsing Bug

  I discovered that the title-block.scss file uses layer boundary markers that don't match TS Quarto's own regex:

  The File Content (title-block.scss)

  /*-- scss: functions --*/    ← Line 1: space AFTER colon
  @function bannerColor() { ... }

  /*-- scss:variables --*/     ← Line 32: "variables" not a valid name
  $title-banner-color: null !default;

  /*-- scss:rules --*/         ← Line 37: VALID marker
  .quarto-title-banner { ... }

  TS Quarto's Regex

  "^\/\\*\\-\\-[ \\t]*scss:(uses|functions|rules|defaults|mixins)[ \\t]*\\-\\-\\*\\/$"

  This regex has two requirements that title-block.scss violates:

  1. No space after colon: The regex is scss:(...) with no whitespace between : and the layer name. But line 1 has scss: functions (with a space).
  2. Only 5 valid layer names: uses|functions|rules|defaults|mixins. But line 32 uses variables, which isn't in this list.

  The Result

  In TS Quarto, when parsing title-block.scss:
  - Line 1 (/*-- scss: functions --*/) does NOT match
  - Line 32 (/*-- scss:variables --*/) does NOT match
  - Line 37 (/*-- scss:rules --*/) DOES match

  So all content before line 37 (the functions AND variables) gets dumped into the defaults section (the initial accumulator). Only the /*-- scss:rules --*/
  marker is recognized.

  Why It "Works"

  The SCSS still compiles because:
  - Functions in defaults aren't ideal but work (SCSS is permissive about order within the assembled string)
  - Variables in defaults is actually where they should be (!default variables)
  - Rules get correctly separated

  But this means the layer separation is not working as intended - the functions should be in the functions section so they appear before the defaults in the
  final assembled SCSS.
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.