Brand your Quarto projects with

b
r
a
n
d
.
y
m
l


R-Ladies Philly

March 12, 2025 @ 11am CT

Introduction

ivelasq

ivelasq3

ivelasq3

ivelasq.rbind.io

Background

Background

Background

Aesthetic
Usability
Effect

library("ggplot2")
library("ggthemes")

ggplot(mtcars) +
  geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
  facet_wrap( ~ am) +
  scale_y_continuous(position = "right") +
  theme_economist() +
  scale_colour_economist()

Challenges with branding

  • Excessive manual effort
  • Difficult to update
  • Team consistency




brand.yml

  1. Define branding in a single _brand.yml file.
  2. Instantly apply branding across Quarto documents, Shiny apps, and more.

Where does it work?

brand.yml elements

  • 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: Example Company
  link: 
    github: https://github.com/example-company

logo: 
  medium: logos/logo.png

color:
  palette:
    black: "#1C2826"
    blue: "#0C0A3E" 
    neutral: "#F9F7F1" 
    red: "#BA274A"
    violet: "#4D6CFA"
  background: neutral
  foreground: black
  primary: blue
  secondary: violet
  danger: red

typography:
  fonts:
    - family: Nunito Sans
      source: google
    - family: Montserrat
      source: google
    - family: Fira Code
      source: google

  base: Nunito Sans
  headings:
    family: Montserrat
    weight: 700
    color: primary
  monospace: Fira Code
  link:
    color: danger
    decoration: underline

Metadata

Metadata

meta:
  name: Acme Corporation
  link: https://www.acmecorp.com

Metadata

meta:
  name: Acme Corporation
  link: 
    home: https://www.acmecorp.com
    github: https://github.com/acmecorp

Metadata

meta:
  name:
    full: Acme Corporation International
    short: Acme
  link:
    home: https://www.acmecorp.com
    docs: https://docs.acmecorp.com
    github: https://github.com/acmecorp
    bluesky: https://bsky.app/profile/acmecorp.bsky.social
    twitter: https://twitter.com/acmecorp
    linkedin: https://www.linkedin.com/company/acmecorp
    facebook: https://www.facebook.com/acmecorp
  description: |
    Acme Corporation is a leading provider of innovative solutions for cartoon
    characters worldwide.
  founded: 1952

Logo

logo: logo.png

Logo

logo:
  small: logos/icon.png
  medium: logos/header-logo.png
  large: logos/full-logo.svg

Logo

logo:
  small: logos/icon.png
  medium:
    light: logos/header-logo.png
    dark: logos/header-logo-white.png
  large: logos/full-logo.svg

Logo

logo:
  images:
    icon: logos/icon.png
    header: logos/header-logo.png
    header-white: logos/header-logo-white.png
    full: logos/full-logo.svg
  small: icon
  medium:
    light: header
    dark: header-white
  large: full

Logo

logo:
  images:
    icon:
      path: logos/icon.png
      alt: "Company icon with abstract shapes"
    header:
      path: logos/header-logo.png
      alt: "Company name with logo"
    header-white:
      path: logos/header-logo-white.png
      alt: "Company name with logo in white"
    full:
      path: logos/full-logo.svg
      alt: "Full company logo with tagline"
  small: icon
  medium:
    light: header
    dark: header-white
  large: full

Colors

Colors

color:
  palette:
    black: "#1C2826"
    blue: "#0C0A3E" 
    neutral: "#F9F7F1" 
    red: "#BA274A"
    violet: "#4D6CFA"

Colors

color:
  . . .
  
  foreground: black # Main text color
  background: white # Main background color
  primary: blue # Primary accent color, used for hyperlinks, etc.
  secondary: "#707073" # Secondary accent color, often used for lighter text
  tertiary: "#C2C2C4" # Tertiary accent color
  success: green # Color used for positive or successful actions
  info: teal # Color used for neutral or informational actions
  warning: orange # Color used for warning or cautionary actions
  danger: burgundy # Color used for errors, dangerous actions
  light: white # Bright color, used as a high-contrast foreground color
  dark: "#404041" # Dark color, used as a high-contrast foreground color

Colors

color:
  palette:
    white: "#FFFFFF"
    black: "#151515"
    blue: "#447099"
    orange: "#EE6331"
    green: "#72994E"
    teal: "#419599"
    burgundy: "#9A4665"

  foreground: black
  background: white
  primary: blue
  secondary: "#707073"
  tertiary: "#C2C2C4"
  success: green
  info: teal
  warning: orange
  danger: burgundy
  light: white
  dark: "#404041"

Colors

color:
  foreground: "#151515"
  background: "#FFFFFF"
  primary: "#447099"
  secondary: "#707073"
  tertiary: "#C2C2C4"
  success: "#72994E"
  info: "#419599"
  warning: "#EE6331"
  danger: "#9A4665"
  light: "#FFFFFF"
  dark: "#404041"

Typography

Typography

typography:
  base: Open Sans
  headings: Roboto Slab
  monospace: Fira Code

Typography

typography:
  base:
    family: Open Sans
  headings:
    family: Roboto Slab
  monospace:
    family: Fira Code

Typography

typography:
  fonts:
    - family: Open Sans
      source: google
    - family: Roboto Slab
      source: google
    - family: Fira Code
      source: google

Typography

typography:
  fonts:
    - family: Open Sans
      source: bunny
    - family: Roboto Slab
      source: bunny
    - family: Fira Code
      source: bunny

Typography

typography:
  fonts:
    # Local files
    - family: Open Sans
      source: file
      files:
        - path: fonts/open-sans/OpenSans-Variable.ttf
        - path: fonts/open-sans/OpenSans-Variable-Italic.ttf
          style: italic
    # Online files
    - family: Closed Sans
      source: file
      files:
        - path: https://example.com/Closed-Sans-Bold.woff2
          weight: bold
        - path: https://example.com/Closed-Sans-Italic.woff2
          style: italic

Typography

typography:
  fonts:
    - family: Open Sans
      source: google
    - family: Roboto Slab
      source: google
    - family: Fira Code
      source: google
  base: Open Sans #  Font and appearance settings for the base (body) text
  headings: Roboto Slab #  Font and appearance settings for heading text
  monospace: Fira Code # Font and appearance settings for monospaced text 
  link: Fira Code   #Font and appearance settings for hyperlink text

Typography

. . .
  base:
    family: Open Sans
    line-height: 1.25
    size: 1rem
  headings:
    family: Roboto Slab
    color: primary
    weight: 600
  monospace:
    family: Fira Code
    size: 0.9em

Defaults

Defaults

defaults:
  bootstrap:
    defaults:
      enable-rounded: false
      link-decoration: none

brand.yml inspiration

Let’s try it out!

Creating a brand.yml with an LLM

Creating a brand.yml with an LLM

  • Explain brand.yml using the provided Markdown file in either a chat interface or as a system prompt
  • Then, follow up with additional instructions: Create a _brand.yml for {company} using the following context from {company}'s' brand guidelines
  • Test it out using the Shiny example app

Using _brand.yml values

Beyond the automatic application of your brand file, you can also directly access _brand.yml values in Quarto documents via the brand shortcode.

document.qmd
{{< brand logo LOGO_NAME >}}


document.qmd
`## Slide Title {background-color='{{< brand color primary >}}'}`

brand.yml structure (outside of Quarto Projects)

document.qmd
---
brand:
  color:
    background: "#fff"
---

Let’s try it out!

Disabling brand.yml

Disable brand for a document by setting brand to false:

document.qmd
---
brand: false
---

Theming priority

Keep in mind that _brand.yml always takes lowest priority in styles.

_quarto.yml
theme:
  - brand        # theming derived from `_brand.yml`
  - cosmo        # a predefined bootswatch theme
  - tweaks.scss  # a user-defined customization

Theming priority

Keep in mind that _brand.yml always takes lowest priority in styles.

_quarto.yml
theme:
  - cosmo        # a predefined bootswatch theme
  - brand        # theming derived from `_brand.yml`
  - tweaks.scss  # a user-defined customization

Sharing brand.yml

  • Create an extension
  • Upload to a GitHub repo where it can be downloaded

Summary

brand.yml allows you to collect a brand’s logos, colors, fonts, and typographic choices into a single _brand.yml file, which you can then apply instantly across Quarto reports, Shiny apps, and more.

  • Consistency without effort
  • Easy collaboration
  • Not just for corporate branding

Future of brand.yml

  • Plots and tables
  • Additional development in LLM tools

Join the discussion!



T
h
a
n
k
y
o
u
!