Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/changelog-1.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ All changes included in 1.9:
- ([#11929](https://github.com/quarto-dev/quarto-cli/issues/11929)): Import all `brand.typography.fonts` in CSS, whether or not fonts are referenced by typography elements.
- ([#13413](https://github.com/quarto-dev/quarto-cli/issues/13413)): Fix uncentered play button in `video` shortcodes from cross-reference divs. (author: @bruvellu)
- ([#13508](https://github.com/quarto-dev/quarto-cli/issues/13508)): Add `aria-label` support to `video` shortcode for improved accessibility.
- ([#13825](https://github.com/quarto-dev/quarto-cli/issues/13825)): Fix `column: margin` not working with `renderings: [light, dark]` option. Column classes are now preserved when applying theme classes to cell outputs.

### `typst`

Expand Down
7 changes: 5 additions & 2 deletions src/resources/filters/quarto-post/cell-renderings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ function choose_cell_renderings()
blocks:insert(darkDiv)
end
elseif quarto.format.isHtmlOutput() and lightDiv and darkDiv then
blocks:insert(pandoc.Div(lightDiv.content, pandoc.Attr("", {'light-content'}, {})))
blocks:insert(pandoc.Div(darkDiv.content, pandoc.Attr("", {'dark-content'}, {})))
-- Preserve existing classes (e.g., column-margin, cell-output-display) and add theme class
lightDiv.classes:insert('light-content')
darkDiv.classes:insert('dark-content')
blocks:insert(lightDiv)
blocks:insert(darkDiv)
else
blocks:insert(lightDiv or darkDiv)
end
Expand Down
27 changes: 27 additions & 0 deletions tests/docs/smoke-all/dark-mode/renderings-column-margin.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "renderings with column-margin"
format:
html:
theme:
light: flatly
dark: darkly
_quarto:
tests:
html:
ensureHtmlElements:
-
- 'div.cell div.column-margin div.cell-output-display.light-content'
- 'div.cell div.column-margin div.cell-output-display.dark-content'
- []
---

This tests that `column: margin` works together with `renderings: [light, dark]`.
The column-margin class should be preserved when creating light/dark content divs.

```{r}
#| column: margin
#| renderings: [light, dark]

knitr::kable(data.frame(x = "Light mode", y = 1))
knitr::kable(data.frame(x = "Dark mode", y = 2))
```
Loading