Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): Branded theming via brand.yml (#1148)
* feat(resolve_bs_preset): Support brand ``` theme: preset: brand ``` ``` theme: preset: { brand: "path/to/brand.yml" } ``` * feat: read_brand_yml (not exported) * feat: Brand theme includes base theme from brand.yml * feat: Add brand example app * feat: Add brand base and colors as first brand layer * feat: Add brand defaults * feat: Add brand.color defaults * feat: Add brand typography * chore: consistent return values * feat: Add brand fonts * chore: tweak and improve example app * fix: ensure return type consistency * feat: include `brand` as an attribute of the bslib theme object * feat: Example app updates * Resave data (GitHub Action) * Update website deps (GitHub Action) * chore: download font files on first run * feat: File fonts can be URLs * tests: Update tests * chore: Add {lobstr} to Suggests * fix: Remove `|>` syntax, add clarifying comment * feat: Normalize `brand.color` on read and detect cycles * Resave data (GitHub Action) * tests: maybe_convert_font_size_to_rem * tests(b_get_color): Add test for null case * chore: remove unused function * feat(brand_resolve_preset): Use S3 class for many ways to create a brand preset * feat: "brand" is now a builtin theme * chore: don't use str because it comes from {utils} * tests: normalize `brand$path` * chore: style * chore: Add {tools} and {utils} to Suggests * feat: inline brand definitions are allowed * tests: update snapshot * tests: fix path test for Windows * fix: actually fix path comparison * feat: Update _brand-yml.scss after `$default` fix * chore: rename brand example app file * feat(bs_theme): Separate `preset` and `brand` arguments Tests are not updated yet * tests: Update brand theming tests * `devtools::document()` (GitHub Actions) * Update website deps (GitHub Action) * fix: remove unused call * feat: brand_resolve(NULL) finds brand if available, silent if not * tests: clean up unused tests brand and preset are no longer entangled * `devtools::document()` (GitHub Actions) * test: `brand_resolve(FALSE)` returns `NULL` * chore: remove print method and lobstr dependency Saving a real print method for the `brand.yml` package * tests(brand_resolve_preset) * Add white space to trigger CI * chore: undo changes to `resolve_bs_preset()` * chore: use `sass::sass_file()` * feat: warn if brand is used with Bootstrap <= 4 * fix: Add missing font family to error message * refactor: Use `abort()` across the board * chore: trim whitespace of css value * refactor: early return on its own * fix: oops * refactor: simplify `path_is_file()` * chore: add comment that we're borrowing from tools::file_ext() * chore: suggested imports * docs: make note of brand example * `yarn build` (GitHub Actions) * docs: callouts for h3-h5 * docs: Add brand.yml article * docs(article): Edits and moving around * chore: remove unused brand.yml logo * chore: fix typo in brand.yml * feature(app): live edit brand.yml in the app * feat: Add light-weight prism-code-editor * chore: Use env for error message storage * feat: Toggle editor from navbar * feat: Use ExtendedTask for long-running plot * chore: clean up logo section of example _brand.yml * chore: format * Resave data (GitHub Action) * chore: strip ansi chars from error message * chore: increase theme update delay * docs: Add news item * Update website deps (GitHub Action) * chore: remove dev code from example app * rename: `b_get()` -> `brand_pluck()`, etc. * fix: Set default google font style * fix: `.brand-font-{family}` class name * chore: add a comment that fonts aren't dynamically updated * chore: format * Update website deps (GitHub Action) * chore: simplify ansi color code removal * chore: remove pkgload local dev code (again) * chore: tweak error message * docs(bs_theme): `brand=NULL` is the default * chore: finalize example _brand.yml * refactor: Rename example `brand.yml` * feat: Only allow saving the `_brand.yml` file if used as template * `devtools::document()` (GitHub Actions) * feat: put editor in a card in a black-background sidebar * fix(brand_color_pluck): Return `NULL` values, otherwise assert string values * refactor: simplify null/string check
- Loading branch information