- 3 Minutes Wednesdays
- Posts
- 3MW (Brand.yml: One Theme to Style Them All ✨)
3MW (Brand.yml: One Theme to Style Them All ✨)
Enjoy 3 Minute Wednesdays at no cost.
This newsletter is brought to you for free. If you want to advance your R skills and support my work at the same time, then you will like my paid offerings:
Guten Tag!
Many greetings from Munich, Germany. Have you heard about brand.yml
? It’s one of Posit’s newest and most exciting additions to their product lineup. With brand.yml
, you can define a unified theme that works seamlessly across
Quarto documents,
Shiny for R apps, and
Shiny for Python apps.
In today’s newsletter, I’ll walk you through what brand.yml
is and how to use it to bring consistent styling to all your projects.
What’s the idea?
The idea behind brand.yml
is simple but powerful:
You define your primary color, secondary color, fonts, logo, and other branding settings in a single
brand.yml
file.You can then reuse that same configuration across all your data products. No need to redefine styles in each individual project.
This makes it easier to
maintain consistent branding,
reuse themes across projects, and
share themes across teams.
How does this work?
You’re probably now wondering: What does a brand.yml
file actually look like? Well, let me show you. It’s just a plain text YAML file. Here’s an example from the official docs:

As you can see, it looks pretty simple. But this simple file becomes the central definition of your app or document’s look and feel.
How to Use brand.yml
?
The way you use this file depends on your toolchain. Here’s a breakdown for each use case:
📄 In Quarto
First, you need to save the branding content into a file called _brand.yml
. And to apply the brand in a Quarto document you just have to add the brand
attribute to the YAML header and fill it with the path to your yml-file. This could look something like this:

It doesn’t get any easier than that. And if you want to use the specified branding options (e.g. colors) in a particular setting (like Typst PDFs), then you can check out the dedicated Quarto documentation on that.
💻 In Shiny for R
In Shiny for R, brand.yml
is integrated via the fantastic {bslib}
package.
You can use it in your UI definition like so:

🐍 In Shiny for Python
You’ll need the latest version of Py-Shiny installed with the theme
extra.

Once you’ve got that, you can use brand.yml
like this:

And if you’re using Py-Shiny Express, the usage is slightly different. There, you’ll have to configure the page_options
argument in the UI object.

I think brand.yml
is a fantastic idea. It simplifies theming, supports consistency, and works beautifully across multiple frameworks. If you’re building out a data product pipeline that includes reports and interactive apps, this tool will save you time and help keep everything looking polished and on-brand.
Let me know what you think about brand.yml
. And as always, if you have any questions, or just want to reach out, feel free to contact me by replying to this mail or finding me on LinkedIn or on Bluesky.
See you next week,
Albert 👋
Enjoyed this newsletter? Here are other ways I can help you:
Reply