quarto-dev / quarto-dev/quarto-cli

[revealjs] Global custom theme configuration that is not override locally

Open
#4,193 4 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Mar 20, 2023.

enhancement revealjs
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Opening this to think about it further. See discussion

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/4182

Originally posted by sagikazarmark February 1, 2023
I want to include a certain piece of CSS in all of my slides (regardless of the theme), but still want to be able to use custom CSS on a per slide basis if I want to.

Currently if I set a default value for theme with a custom css file, it gets overridden as soon as I pick another theme in a slide (which is kind of expected).

I'd like to be able to include a CSS file in addition to the theme.

A good enough workaround for now is using include-in-header, but that can still be overridden.

(More details shared later)

Here is what I have in my _quarto.yml file:

format:
  revealjs: 
    theme: [default, custom.scss]

Then in any slide, if I want to use another theme:

---
format:
  revealjs: 
    theme: sky
---

I want to be able to include my custom.scss in all of my slides without having to remember to include it when I don't use the default value.

What I'm currently doing is I have include-in-header defined in my _quarto.yml to include custom CSS. I don't use include-in-header at the moment anywhere in my slides which is why I can rely on the default.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.