Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): Branded theming via brand.yml #1148

Merged
merged 101 commits into from
Jan 7, 2025
Merged

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Dec 9, 2024

Adds support for branded theming via bs_theme(brand = TRUE).

There are few choices:

# Automatically find `_brand.yml` in app dir or its parents
bs_theme()

# Find `_brand.yml` in app dir or its parents, or fail otherwise
bs_theme(brand = TRUE)

# Direct path to a brand.yml file
bs_theme(brand = "path/to/brand.yml")

# Ignore an existing `_brand.yml` file, apply no branding
bs_theme(brand = FALSE)

# Provide a brand definition inline
bs_theme(brand = list(color = list(primary = "#466683")))

Or in YAML where bs_theme() is called:

theme:
  brand: true

theme:
  brand: false

theme:
  brand: "path/to/brand.yml"

theme:
  brand:
    color:
      primary: "#466683"

TODO

  • Tests
  • Documentation - Update function docs in bs_theme()
  • Documentation - Article on pkgdown site?
  • Build ignore Monda.ttf and download it as needed on app load

gadenbuie and others added 30 commits December 5, 2024 16:05
```
theme:
  preset: brand
```

```
theme:
  preset: { brand: "path/to/brand.yml" }
```
R/bs-theme-preset-brand.R Outdated Show resolved Hide resolved
R/bs-theme.R Show resolved Hide resolved
@@ -6,6 +6,10 @@

Related to the above change, `navset_bar()` now defaults to using `underline = TRUE` so that both `page_navbar()` and `navset_bar()` use the same set of default `navbar_options()`.

## New features

* bslib now supports unified theming with [brand.yml](https://posit-dev.github.io/brand-yml). brand.yml lets you theme your Shiny apps, Quarto documents and more with a single, portable YAML file. Learn more in the new [Unified theming with brand.yml](https://rstudio.github.io/bslib/dev/articles/brand-yml/) article. (#1148)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update this link before release (remove dev from URL)

@gadenbuie gadenbuie merged commit 0977ad7 into main Jan 7, 2025
13 checks passed
@gadenbuie gadenbuie deleted the feat/theme-brand-yml branch January 7, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants