07:00
Quarto uses the popular Bootstrap library for HTML structure and CSS styles.
You can use Bootstrap components and classes for special styling
↓
Quarto includes 25 themes from Bootswatch:
Specify the custom theme under theme
in the YAML settings:
_quarto.yml
.07:00
Sometimes we want to change theme settings though
Many common basic options: https://quarto.org/docs/output-formats/html-themes.html#basic-options
HTML elements can have IDs and classes
HTML elements can be nested inside each other
You can target HTML elements with different degrees of specificity:
All <h3> headings
H3 headings with the class neato
<a> links that are inside a div with the id quarto-sidebar
Explore and edit any HTML and CSS right from your browser.
variables
rules that use variables
asdf
Create a SCSS file and make a bunch of rules
Organizations and projects generally have style guides for consistency
Urban Institute
This course! See the colophon
Unified branding with a simple YAML file
Create reports, apps, dashboards, plots and more that match your company’s brand guidelines with a single _brand.yml
file.
Learn more: https://posit-dev.github.io/brand-yml/
Branding can be frustrating
But brand.yml makes it easier
1. Define branding in a single _brand.yml
file.
2. Apply that branding across almost all Quarto formats.
brand.yml
also works with Shiny!
--- config: look: handDrawn theme: neutral --- flowchart LR by{brand.yml} by-->quarto[Quarto] quarto-->quarto-html quarto-->quarto-pdf quarto-html-->quarto-websites[Websites] quarto-html-->quarto-presentations[Presentations] quarto-html-->quarto-dashboards[Dashboards] quarto-html-->quarto-emails[Emails] quarto-pdf-->quarto-typst[Typst] by-->R R-->r-bslib["{bslib}"] r-bslib-->r-thematic["{thematic}"] r-bslib-->r-shiny["Shiny for R"] r-bslib-->r-rmd["R Markdown"] r-bslib-->r-pkgdown["pkgdown"] %% r-thematic-->r-ggplot2["{ggplot2}"] %% r-thematic-->r-plot["{plot}"] by-->Python Python-->py-brand_yml["brand_yml"] py-brand_yml-->py-shiny[Shiny for Python] py-brand_yml-->py-plots[seaborn, matplotlib, etc.] classDef implemented fill:#8CE3A0,stroke:#0A2911,color:#0A2911; classDef partial fill:#A8E5B9,stroke:#4B8A5D,color:#0A2911; classDef in-progress fill:#B3D7FF,stroke:#00254D,color:#00254D; classDef highlighted fill:#FFE8DB,stroke:#612200,color:#612200; class quarto-websites,quarto-presentations,quarto-dashboards,quarto-typst,py-brand_yml,py-shiny,r-bslib,r-shiny,r-rmd,r-pkgdown implemented; class r-thematic,py-plots partial; class by highlighted; click quarto href "https://prerelease.quarto.org/docs/authoring/brand.html" click quarto-typst href "https://quarto.org/docs/output-formats/typst.html" "Typst in Quarto" click quarto-presentations href "https://quarto.org/docs/presentations/revealjs/" "Reveal.js in Quarto" click quarto-dashboards href "https://quarto.org/docs/dashboards/" "Dashboards in Quarto" click r-shiny href "https://shiny.posit.co/" click r-bslib href "https://rstudio.github.io/bslib/" click r-thematic href "https://rstudio.github.io/thematic/" click r-ggplot2 href "https://ggplot2.tidyverse.org/" click r-rmd href "https://rmarkdown.rstudio.com/" click py-shiny href "https://shiny.posit.co/py/" click py-brand_yml href "pkg/py/"
Learn more: https://posit-dev.github.io/brand-yml/
meta
: Identifying information, name of the company, URLs, etc.logo
: Files or links to the brand’s logos.color
: Colors in the brand’s color palette.typography
: Fonts for different elements.defaults
: Additional context-specific settings._brand.yml
structure_brand.yml
meta:
name: World Happiness Report
link:
home: https://www.worldhappiness.report/
logo:
images:
icon:
path: images/whr_logo.png
alt: World Happiness Report icon.
small: images/whr_logo.png
color:
palette:
dark-purple: "#93358c"
light-purple: "#f8f6fb"
teal: "#04afaf"
dark-blue: "#086992"
hot-pink: "#eb068c"
light-blue: "#1aade4"
background: light-purple
foreground: black
primary: dark-purple
secondary: hot-pink
tertiary: light-blue
dark: black
typography:
fonts:
- family: Libre Franklin
source: google
weight: [400, 700]
base:
family: Libre Franklin
weight: 400
headings:
family: Libre Franklin
weight: 700
color: dark-purple
link:
color: primary
decoration: none
_brand.yml
.Quarto will detect the presence of _brand.yml
and automatically apply the brand to all documents of the supported formats in the project.
If your brand file has a different name or lives in a subdirectory, use the brand
key.
To turn off brand.yml for a document, use brand: false
.
brand
shortcodeAccess some brand.yml values with a shortcode.
05:00
The quarto packages contain theme helpers that apply branding to plots.
05:00
Access and apply specific brand elements.