-
Couldn't load subscription status.
- Fork 114
feat(theme): Branded theming via brand_yml #1743
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
f0b3464
feat: initial BrandTheme
gadenbuie 730af5c
feat: rename ThemeBrand
gadenbuie b73470f
feat: Add `_brand*.yml` to default reload includes
gadenbuie ef936ea
feat(Theme): Add `from_brand()` method
gadenbuie 9ebf4a5
docs: Add brand-yml to interlinks inventories
gadenbuie 9fe9714
chore: add brand_yml to dev dependencies too
gadenbuie 3943ebc
chore(Theme): Rename method `_html_dependencies`
gadenbuie 669e08a
feat: get fonts dependency from brand.typography
gadenbuie 263ee07
chore: clean up code
gadenbuie 6035788
feat: Apply brand.color.palette to bootstrap color map
gadenbuie 3184691
fix: Use Bootstrap major version
gadenbuie 137cc4c
chore: Add todo comments
gadenbuie 949f6f1
refactor: Move ThemeBrand init code into constructor
gadenbuie 2af0941
feat(ThemeBrand): sanitize color name into valid sass/css variable names
gadenbuie 03adf5c
refactor: Use `brand.color.to_dict()` method
gadenbuie ced644a
chore: Apply suggestions from code review
gadenbuie 409a53b
refactor: More strongly type sass var maps
gadenbuie dcf4e32
refactor: Don't version the bootstrap color list
gadenbuie 948ddce
refactor: Consolidate all brand.color sass var logic
gadenbuie 142409e
refactor: Raise ThemeBrandUnmappedFieldError following envvar
gadenbuie 048622e
chore: Update brand.ya?ml reload includes
gadenbuie 96a9b95
Merged origin/main into feat/brand-yml
gadenbuie fc66b21
feat: Convert `typography.base.size` to `rem` for Bootstrap
gadenbuie 20b1210
feat(brand): Add example app and brand
gadenbuie b905415
feat(brand): finish mapping the variables
gadenbuie 95ffd5a
chore: Add some notes in example brand
gadenbuie db42401
chore: add a few more notes
gadenbuie f785d75
refactor: Simplify splitting css value and unit
gadenbuie aaed92a
chore: link back to bootstrap source for code rules
gadenbuie a012b8a
fix(brand): Map typography.link.color to $link-color-dark too
gadenbuie a9fb968
feat(example): Add colors page
gadenbuie 5624064
fix(typing): of split_css_value_and_unit()
gadenbuie 67e9b7d
feat(brand): Swap foreground/background in dark mode
gadenbuie c772164
feat(brand): Pick white/black from brand's foreground/background and …
gadenbuie 2573e0a
feat(brand-example): Add color swatch page
gadenbuie e05ab3d
chore: remove sass debug output
gadenbuie 484c89b
feat(brand): restore card borders in dark mode if brand makes dark mode
gadenbuie 51cf4f1
feat(brand): Mix of font sources
gadenbuie 75ab45d
fix(brand): Rules for code-block-line-height
gadenbuie 792af38
refactor: ._handle_unmapped_variable method
gadenbuie c5f6302
refactor(ThemeBrand): Separate into smaller methods
gadenbuie 0fe7fa1
chore(brand): rename methods and add sass comments for dividers
gadenbuie b1d0ccc
refactor: move theme method calls into helper methods
gadenbuie a4eee03
refactor: factor out get_theme_name
gadenbuie ab5085e
refactor: Rename BrandBootstrapConfig
gadenbuie 75a7f97
feat: read layers from `brand.defaults.shiny.theme.*`
gadenbuie 438605f
chore: Add `!default` flag
gadenbuie f083519
chore: early return in no-op case
gadenbuie dbc4759
refactor: Static method for brand to sass variable helpers
gadenbuie 6e57945
fix: brand-yml inventory objects location
gadenbuie 1c2a504
feat(typography): Map inline code color to $code-color-dark
gadenbuie 9591fb2
example(brand): Keep navbar visible
gadenbuie 721b1be
feat: check that brand_yml is installed before using
gadenbuie c314806
refactor(BrandBootstrapConfig): Make static methods
gadenbuie cf103d8
refactor: return brand/bootstrap color sass vars separately
gadenbuie 82b4493
chore: set black/white to brand black white if not set
gadenbuie 59b93c9
refactor: simplify return value
gadenbuie 9e8211c
chore(types): Fix return value
gadenbuie 22bd9bd
refactor: Move preset checking into `ui.Theme()`
gadenbuie 1242c6d
fix: defaults from `defaults.bootstrap`
gadenbuie 9bebe72
fix: rework layer adding to ensure correct order
gadenbuie 0d72daa
chore: update type hint
gadenbuie fa78936
temp: switch to brand_yml from github
gadenbuie f7f5605
refactor: brand_yml now handles validation of `color.palette` names
gadenbuie 16db15d
chore: use `_add_defaults_hdr()` in additional place
gadenbuie af8532a
refactor: don't use `as_css_unit()` just work with strings
gadenbuie 04b3011
refactor: Call `cls` from inside class method
gadenbuie d030f8d
chore(reload): On `yml` and `yaml` changes
gadenbuie 90b03f5
refactor: brand_yml handles converting typography.base.size to rem
gadenbuie 5d059e2
refactor: simplify finding spec or pkg
gadenbuie f2d35b6
chore(examples): Add requirements.txt
gadenbuie 83e4a33
docs: Fill out `.from_brand()` documentation
gadenbuie a34e936
docs: small edit
gadenbuie 9c9b0da
chore: slim type
gadenbuie 439f557
refactor: BrandBootstrapConfig
gadenbuie 805aecd
chore: Add changelog item
gadenbuie 65ae093
chore: use released brand_yml
gadenbuie bda5054
chore: create new dict
gadenbuie 9b73147
chore: only import brand for type checking
gadenbuie 75dcf2a
Update CHANGELOG.md
cpsievert 51dc33b
Update _theme_brand.py
gadenbuie 339a9aa
example: use layout_sidebar() not page_sidebar()
cpsievert edbae14
example: pass brand colors along to plotting code (instead of repeati…
cpsievert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from shiny.express import input, render, ui | ||
|
|
||
| ui.page_opts(theme=ui.Theme.from_brand(__file__)) | ||
|
|
||
| ui.input_slider("n", "N", 0, 100, 20) | ||
|
|
||
|
|
||
| @render.code | ||
| def txt(): | ||
| return f"n*2 is {input.n() * 2}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.