Skip to content

Commit

Permalink
Specify theme directly in RevealJS.
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Apr 4, 2024
1 parent 668f554 commit b849938
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
8 changes: 7 additions & 1 deletion _extensions/webr/qwebr-styling.css
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,17 @@ body.reveal.quarto-dark pre div code.qwebr-output-code-stdout {


/* Create a border around console and output (does not effect graphs) */
.reveal div.qwebr-console-area {
body.reveal.quarto-light div.qwebr-console-area {
border: 1px solid #EEEEEE;
box-shadow: 2px 2px 10px #EEEEEE;
}

body.reveal.quarto-dark div.qwebr-console-area {
border: 1px solid #111;
box-shadow: 2px 2px 10px #111;
}


/* Cap output height and allow text to scroll */
/* TODO: Is there a better way to fit contents/max it parallel to the monaco editor size? */
.reveal div.qwebr-output-code-area pre {
Expand Down
2 changes: 1 addition & 1 deletion docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ format:

# Allow quarto to switch between light and dark themes.
theme:
light: flatly
light: cosmo
dark: darkly
12 changes: 11 additions & 1 deletion docs/qwebr-theming.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The Monaco editor used by `{quarto-webr}` to power interactive code cells respec

```yaml
theme:
light: flatly
light: cosmo
dark: darkly
```
Expand All @@ -150,3 +150,13 @@ Once set, a clickable toggle will appear on the page that can switch between the
:::{.callout-note}
The Monaco editor's theme automatically adjusts based on the document's theme. It uses a light theme (`vs`) in light mode and a dark theme (`vs-dark`) in dark mode.
:::

### RevealJS

For RevealJS, please note you may only specify [a single RevealJS theme](https://quarto.org/docs/presentations/revealjs/themes.html#using-themes) at a time. We recommend specifying either `default` (for light mode) or `dark` (for dark mode).

```yaml
format:
revealjs:
theme: default
```
2 changes: 1 addition & 1 deletion tests/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ website:

# Allow quarto to switch between light and dark themes.
theme:
light: flatly
light: cosmo
dark: darkly

# Set the language that should be used for Quarto websites
Expand Down
4 changes: 3 additions & 1 deletion tests/qwebr-test-revealjs.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: "Test: webR in RevealJS"
subtitle: "Examining State"
authors: "Presentation Lead"
format: revealjs
format:
revealjs:
theme: dark
engine: knitr
filters:
- webr
Expand Down
4 changes: 3 additions & 1 deletion tests/qwebr-test-status-header-suppressed-revealjs.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: "Test: No Startup Status Present in RevealJS Presentations"
subtitle: "Examining State"
authors: "Presentation Lead"
format: revealjs
format:
revealjs:
theme: default
engine: knitr
webr:
show-startup-message: false
Expand Down

0 comments on commit b849938

Please sign in to comment.