Skip to content

Custom theme sass file for light mode unexpectedly applied to dark mode #3705

@sun123zxy

Description

@sun123zxy

Bug description

I'm running quarto 1.2.269 on Windows, using sass files to customize HTML output. It seems that custom theme files for light mode are unexpectedly applied to dark mode.

For example, consider this qmd file:

---
title: Test
format:
  html:
    theme:
      light: [flatly, "custom.scss"]
      dark: [darkly]
---

and in custom.scss:

/*-- scss:rules --*/
body::after{
    content: "foo";
}

I expected to get "foo" in light mode only. However, after rendering, "foo" can be seen in both light and dark mode.

I guess this might have something to do with bootstrap.min.css and bootstrap-dark.min.css included in <head>, since both of them are applied in dark mode.

Apologize if I've missed something obvious. Thanks!

Checklist

  • Please include a minimal, fully reproducible example in a single .qmd file? Please provide the whole file rather than the snippet you believe is causing the issue.
  • Please format your issue so it is easier for us to read the bug report.
  • Please document the RStudio IDE version you're running (if applicable), by providing the value displayed in the "About RStudio" main menu dialog?
  • Please document the operating system you're running. If on Linux, please provide the specific distribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghtmlIssues with HTML and related web technology (html/css/scss/js)themesRelated to HTML theming or any other style related issue (like highlight-style)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions