-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Labels
bootstrapbugSomething isn't workingSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)Issues with HTML and related web technology (html/css/scss/js)themesRelated to HTML theming or any other style related issue (like highlight-style)Related to HTML theming or any other style related issue (like highlight-style)
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
bootstrapbugSomething isn't workingSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)Issues with HTML and related web technology (html/css/scss/js)themesRelated to HTML theming or any other style related issue (like highlight-style)Related to HTML theming or any other style related issue (like highlight-style)