Carlos Scheidegger @ Mayo Clinic, 2024-07-09
Note
Quarto is designed to grow with you, and offers you complete extensibility when you need it. (That, of course, comes with a larger needed effort).
Add to your _quarto.yml
configuration, or to document front matter:
Quarto ships with all 25 bootswatch themes.
Add this:
Add to your configuration:
The CSS stylesheet will be added to your document, and it can be as simple as
To unlock deeper configurability of Quarto’s styling, including 1,400+ variables that control fonts, colors, padding, etc, you’ll eventually want to learn SCSS. Add to your configuration:
For example:
/*-- scss:functions --*/ // <- these are needed in Quarto!
@function invert($color, $amount: 100%) {
$inverse: change-color($color, $hue: hue($color) + 180);
@return mix($inverse, $color, $amount);
}
/*-- scss:defaults --*/
$primary-color: #036;
/*-- scss:rules --*/
.header {
background-color: invert($primary-color, 80%);
}
More about SCSS in Quarto: https://quarto.org/docs/output-formats/html-themes-more.html
Isabella Velásquez’s Intro to Quarto: https://ivelasq.quarto.pub/intro-to-quarto-2024/#/html-theming
Emil Hvitfeldt’s Slidecraft series: https://emilhvitfeldt.com/post/slidecraft-colors-fonts/
Quarto lets you create an entirely new custom format, and then package it so others in your organization can use it.
Learn more: https://quarto.org/docs/extensions/formats.html
Warning
There’s one annoying Quarto bug we’re going to fix in 1.6: a Quarto project can only have a single SASS theme for all of its documents.
revealjs
is ultimately an HTML format, and so all of the above applies
The HTML that Quarto emits in revealjs
is slightly different from regular webpages, and so the specific themes need to be adapted
More on revealjs
themes: https://quarto.org/docs/presentations/revealjs/themes.html
Learn more about Typst: https://quarto.org/docs/output-formats/typst-custom.html
v1.6
upcoming feature: _brand.yml
Today: different formats require different theming configurations.
Quarto lets you write Markdown once and produce websites, reports, books, presentations, emails, etc. So why don’t we do the same thing for themes?
Note
We intend this feature to solve “90%” of the theming requirements across a variety of formats. But, by the very nature of theming customizations, it can never be a substitute for true custom formats. Still, we expect it to be the feature that users reach first for when creating “branded documents”
_brand.yml
: sneak peek_brand.yml
: sneak peekcolor:
palette:
blue: "#447099"
orange: "#EE6331"
gray: "#404041"
white: "#FFFFFF"
teal: "#419599"
green: "#72994E"
burgundy: "#9A4665"
theme:
foreground: "#151515"
background: white
primary: blue
secondary: "#707073"
tertiary: "#C2C2C4"
success: green
info: teal
warning: orange
danger: burgundy
light: white
dark: gray
_brand.yml
: sneak peek_brand.yml
is more than a Quarto feature_brand.yml
is designed to cut across a wide swath of Posit-supported products. NB: no timeline or promise on any of these!!
thematic
, so both base R plots and grid graphics ie ggplot2
)plotnine
, matplotlib
, seaborn
)gt
+ great_tables
)Quarto themes @ Mayo Clinic https://posit-carlos.quarto.pub/mayo-clinic-jul-2024