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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
11e15d7
feat(resolve_bs_preset): Support brand
gadenbuie Dec 5, 2024
4a68bf6
feat: read_brand_yml (not exported)
gadenbuie Dec 6, 2024
01f3422
feat: Brand theme includes base theme from brand.yml
gadenbuie Dec 9, 2024
630c24d
feat: Add brand example app
gadenbuie Dec 9, 2024
ee57d31
feat: Add brand base and colors as first brand layer
gadenbuie Dec 9, 2024
b8b3c73
feat: Add brand defaults
gadenbuie Dec 9, 2024
a14f5d1
feat: Add brand.color defaults
gadenbuie Dec 9, 2024
1600c20
feat: Add brand typography
gadenbuie Dec 9, 2024
8455b53
chore: consistent return values
gadenbuie Dec 9, 2024
debb707
feat: Add brand fonts
gadenbuie Dec 9, 2024
eb31cca
chore: tweak and improve example app
gadenbuie Dec 9, 2024
8004201
fix: ensure return type consistency
gadenbuie Dec 9, 2024
67d6bb8
feat: include `brand` as an attribute of the bslib theme object
gadenbuie Dec 9, 2024
4fb63dd
feat: Example app updates
gadenbuie Dec 9, 2024
e193a34
Resave data (GitHub Action)
gadenbuie Dec 9, 2024
74ed9bc
Update website deps (GitHub Action)
gadenbuie Dec 9, 2024
2477324
chore: download font files on first run
gadenbuie Dec 9, 2024
c632ee7
feat: File fonts can be URLs
gadenbuie Dec 9, 2024
77c5ad9
tests: Update tests
gadenbuie Dec 9, 2024
d0110bb
chore: Add {lobstr} to Suggests
gadenbuie Dec 9, 2024
a45954c
fix: Remove `|>` syntax, add clarifying comment
gadenbuie Dec 9, 2024
09e5e94
feat: Normalize `brand.color` on read and detect cycles
gadenbuie Dec 10, 2024
80d4c7f
Resave data (GitHub Action)
gadenbuie Dec 10, 2024
038f6a2
tests: maybe_convert_font_size_to_rem
gadenbuie Dec 10, 2024
9bab3c1
tests(b_get_color): Add test for null case
gadenbuie Dec 10, 2024
98ac4ef
chore: remove unused function
gadenbuie Dec 10, 2024
dfd9c9d
feat(brand_resolve_preset): Use S3 class for many ways to create a br…
gadenbuie Dec 10, 2024
16beb21
feat: "brand" is now a builtin theme
gadenbuie Dec 10, 2024
f105690
chore: don't use str because it comes from {utils}
gadenbuie Dec 10, 2024
b4cda0e
tests: normalize `brand$path`
gadenbuie Dec 10, 2024
9b522f9
chore: style
gadenbuie Dec 11, 2024
ab1816b
chore: Add {tools} and {utils} to Suggests
gadenbuie Dec 11, 2024
d09479b
feat: inline brand definitions are allowed
gadenbuie Dec 11, 2024
8fe76a7
tests: update snapshot
gadenbuie Dec 11, 2024
8e25fbe
tests: fix path test for Windows
gadenbuie Dec 11, 2024
57a7c6e
fix: actually fix path comparison
gadenbuie Dec 11, 2024
b835e66
Merged origin/main into feat/theme-brand-yml
gadenbuie Dec 12, 2024
3093ae4
feat: Update _brand-yml.scss after `$default` fix
gadenbuie Dec 12, 2024
b6314ca
chore: rename brand example app file
gadenbuie Dec 12, 2024
dfd71ab
feat(bs_theme): Separate `preset` and `brand` arguments
gadenbuie Dec 13, 2024
6792e29
tests: Update brand theming tests
gadenbuie Dec 13, 2024
95101fb
`devtools::document()` (GitHub Actions)
gadenbuie Dec 13, 2024
86450eb
Update website deps (GitHub Action)
gadenbuie Dec 13, 2024
18bf568
fix: remove unused call
gadenbuie Dec 19, 2024
3168442
feat: brand_resolve(NULL) finds brand if available, silent if not
gadenbuie Dec 19, 2024
5413088
tests: clean up unused tests
gadenbuie Dec 19, 2024
6aa9939
`devtools::document()` (GitHub Actions)
gadenbuie Dec 19, 2024
96735bd
test: `brand_resolve(FALSE)` returns `NULL`
gadenbuie Dec 19, 2024
4cd5cd4
chore: remove print method and lobstr dependency
gadenbuie Dec 19, 2024
2a06507
tests(brand_resolve_preset)
gadenbuie Dec 19, 2024
a56f412
Add white space to trigger CI
schloerke Dec 19, 2024
eca2cc0
chore: undo changes to `resolve_bs_preset()`
gadenbuie Dec 26, 2024
4295d22
chore: use `sass::sass_file()`
gadenbuie Dec 26, 2024
66e4e9f
feat: warn if brand is used with Bootstrap <= 4
gadenbuie Dec 26, 2024
19c3cd1
fix: Add missing font family to error message
gadenbuie Dec 26, 2024
5f2e0c7
refactor: Use `abort()` across the board
gadenbuie Dec 26, 2024
292cf27
chore: trim whitespace of css value
gadenbuie Dec 26, 2024
a1002b9
refactor: early return on its own
gadenbuie Dec 26, 2024
5029146
fix: oops
gadenbuie Dec 26, 2024
4dd54a2
refactor: simplify `path_is_file()`
gadenbuie Dec 26, 2024
9e1c265
chore: add comment that we're borrowing from tools::file_ext()
gadenbuie Dec 26, 2024
80034f5
chore: suggested imports
gadenbuie Dec 26, 2024
4d1d405
Merge branch 'main' into feat/theme-brand-yml
gadenbuie Dec 30, 2024
85c6dd5
docs: make note of brand example
gadenbuie Dec 26, 2024
8c458e1
`yarn build` (GitHub Actions)
gadenbuie Jan 6, 2025
fcab93c
docs: callouts for h3-h5
gadenbuie Jan 6, 2025
0c9b04c
docs: Add brand.yml article
gadenbuie Jan 6, 2025
93474b3
docs(article): Edits and moving around
gadenbuie Jan 6, 2025
e0a278c
chore: remove unused brand.yml logo
gadenbuie Jan 6, 2025
95762f3
chore: fix typo in brand.yml
gadenbuie Jan 6, 2025
b0c6d00
feature(app): live edit brand.yml in the app
gadenbuie Jan 6, 2025
716c5c8
feat: Add light-weight prism-code-editor
gadenbuie Jan 7, 2025
7b1ed31
chore: Use env for error message storage
gadenbuie Jan 7, 2025
35a59ab
feat: Toggle editor from navbar
gadenbuie Jan 7, 2025
68e5c1b
feat: Use ExtendedTask for long-running plot
gadenbuie Jan 7, 2025
e66040f
chore: clean up logo section of example _brand.yml
gadenbuie Jan 7, 2025
3b4585d
chore: format
gadenbuie Jan 7, 2025
c957238
Resave data (GitHub Action)
gadenbuie Jan 7, 2025
ec1151f
chore: strip ansi chars from error message
gadenbuie Jan 7, 2025
a0a89ce
chore: increase theme update delay
gadenbuie Jan 7, 2025
2bebef8
docs: Add news item
gadenbuie Jan 7, 2025
15ac514
Update website deps (GitHub Action)
gadenbuie Jan 7, 2025
77773af
chore: remove dev code from example app
gadenbuie Jan 7, 2025
3afbf28
rename: `b_get()` -> `brand_pluck()`, etc.
gadenbuie Jan 7, 2025
95af06f
fix: Set default google font style
gadenbuie Jan 7, 2025
7210884
fix: `.brand-font-{family}` class name
gadenbuie Jan 7, 2025
ee47eef
chore: add a comment that fonts aren't dynamically updated
gadenbuie Jan 7, 2025
1aff7f7
chore: format
gadenbuie Jan 7, 2025
70ffdc0
Update website deps (GitHub Action)
gadenbuie Jan 7, 2025
90dd65c
chore: simplify ansi color code removal
gadenbuie Jan 7, 2025
c2c5011
chore: remove pkgload local dev code (again)
gadenbuie Jan 7, 2025
9846f12
chore: tweak error message
gadenbuie Jan 7, 2025
bd5b953
docs(bs_theme): `brand=NULL` is the default
gadenbuie Jan 7, 2025
0476707
Merge branch 'main' into feat/theme-brand-yml
gadenbuie Jan 7, 2025
4602718
chore: finalize example _brand.yml
gadenbuie Jan 7, 2025
2e3c477
refactor: Rename example `brand.yml`
gadenbuie Jan 7, 2025
9ef3cf8
feat: Only allow saving the `_brand.yml` file if used as template
gadenbuie Jan 7, 2025
1f4bb0c
`devtools::document()` (GitHub Actions)
gadenbuie Jan 7, 2025
25a1f4a
feat: put editor in a card in a black-background sidebar
gadenbuie Jan 7, 2025
825ff70
fix(brand_color_pluck): Return `NULL` values, otherwise assert string…
gadenbuie Jan 7, 2025
627176a
refactor: simplify null/string check
gadenbuie Jan 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ inst/lib/bsw3/.npmignore
^\.gitattributes$
^CODE_OF_CONDUCT\.md$
^cran-comments\.md$
^inst/examples-shiny/brand.yml/Monda\.ttf$
^inst/examples-shiny/brand.yml/Monda-OFL\.txt$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ vignettes/*/index.html
# rendered examples that appear in iframes
vignettes/**/examples
!vignettes/examples
inst/examples-shiny/brand.yml/Monda-OFL.txt
inst/examples-shiny/brand.yml/Monda.ttf
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ Suggests:
shiny (> 1.8.1),
testthat,
thematic,
withr
tools,
utils,
withr,
yaml
Config/Needs/deploy:
BH,
chiflights22,
Expand Down Expand Up @@ -119,6 +122,7 @@ Collate:
'bs-remove.R'
'bs-theme-layers.R'
'bs-theme-preset-bootswatch.R'
'bs-theme-preset-brand.R'
'bs-theme-preset-builtin.R'
'bs-theme-preset.R'
'utils.R'
Expand Down
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
S3method(as.tags,bslib_sidebar)
S3method(bind_task_button,ExtendedTask)
S3method(bind_task_button,default)
S3method(brand_resolve,"NULL")
S3method(brand_resolve,brand_yml)
S3method(brand_resolve,character)
S3method(brand_resolve,list)
S3method(brand_resolve,logical)
S3method(is_fill_item,default)
S3method(is_fill_item,htmlwidget)
S3method(is_fillable_container,default)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


## Improvements and bug fixes

* `navset_card_pills()`, `navset_card_underline()`, `navset_card_tabs()` fixed to now respect header/footer arguments (@tanho63, #1024)
Expand Down
Loading
Loading