Skip to content

Commit

Permalink
Avoid applying quarto-figure CSS inside html widgets outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv committed Dec 8, 2023
1 parent 218e03d commit 8acbfa5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
- ([#7002](https://github.com/quarto-dev/quarto-cli/issues/7002)): `layout-valign` is correctly forwarded to HTML to tweak vertical figure layout alignment for computational figures.
- ([#5994](https://github.com/quarto-dev/quarto-cli/issues/5994)): Options like `include` or `echo` for `ojs` or `mermaid` cells are now correctly handled with knitr engine.
- ([#4869](https://github.com/quarto-dev/quarto-cli/issues/4869)): `sql` cell output has now correct Quarto treatment so that specific features like `column: margin` works.
- ([#7843](https://github.com/quarto-dev/quarto-cli/issues/7843)): fix an issue with Quarto figure specific css rules applying inside HTML widgets output.

## OJS engine

Expand Down
9 changes: 6 additions & 3 deletions src/resources/formats/html/_quarto-rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,18 @@ figure .quarto-layout-row figure figcaption {
margin-bottom: 0;
}
.quarto-figure-left > figure > p,
.quarto-figure-left > figure > div /* for mermaid and dot diagrams */ {
/* for mermaid and dot diagrams, excluding impact on htmlwidget output */
.quarto-figure-left > figure > div:not(.html-widget, :nth-child(1):not(.html-widget)) {
text-align: left;
}
.quarto-figure-center > figure > p,
.quarto-figure-center > figure > div /* for mermaid and dot diagrams */ {
/* for mermaid and dot diagrams, excluding impact on htmlwidget output */
.quarto-figure-center > figure > div:not(.html-widget, :nth-child(1):not(.html-widget)) {
text-align: center;
}
.quarto-figure-right > figure > p,
.quarto-figure-right > figure > div /* for mermaid and dot diagrams */ {
/* for mermaid and dot diagrams, excluding impact on htmlwidget output */
.quarto-figure-right > figure > div:not(.html-widget, :nth-child(1):not(.html-widget)) {
text-align: right;
}

Expand Down

0 comments on commit 8acbfa5

Please sign in to comment.