Skip to content

Commit 358b17c

Browse files
gadenbuiecpsievert
andauthored
feat: Dynamic theming (#1358)
Co-authored-by: Carson Sievert <cpsievert1@gmail.com> Co-authored-by: Carson Sievert <carson@posit.co>
1 parent 299f821 commit 358b17c

File tree

347 files changed

+28049
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+28049
-508
lines changed

.gitignore

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
# Distribution / packaging
1010
.Python
11-
env/
12-
build/
13-
develop-eggs/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
dist/
11+
/env/
12+
/build/
13+
/develop-eggs/
14+
/downloads/
15+
/eggs/
16+
/.eggs/
17+
/lib/
18+
/lib64/
19+
/parts/
20+
/sdist/
21+
/var/
22+
/wheels/
23+
/dist/
2424
*.egg-info/
2525
.installed.cfg
2626
*.egg

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939

4040
* Relative imports, like `from . import utils`, now can be used in Shiny Express apps. (#1464)
4141

42+
* `ui.Theme` allows you to create custom themes for your Shiny app by recompiling [Bootstrap](https://getbootstrap.com/) and Shiny's Sass files with your own customizations. Themes created with `ui.Theme` can be passed directly to the `theme` argument of `express.ui.page_opts()` (Shiny Express) or `ui.page_*()` functions (Shiny Core) to apply the theme to the entire app. This feature requires the [libsass package](https://sass.github.io/libsass-python/) which can be installed with `pip install libsass`. (#1358)
43+
4244
### Bug fixes
4345

4446
* Fixed #1440: When a Shiny Express app with a `www/` subdirectory was deployed to shinyapps.io or a Connect server, it would not start correctly. (#1442)

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,10 @@ install-deps: FORCE ## install dependencies
207207
# ## If caching is ever used, we could run:
208208
# install-deps: FORCE ## install latest dependencies
209209
# pip install --editable ".[dev,test]" --upgrade --upgrade-strategy eager
210+
211+
upgrade-html-deps: FORCE ## Upgrade Shiny's HTMLDependencies
212+
@if ! Rscript -e "q()"; then \
213+
echo "Error: Upgrading HTML dependencies requires R, but R is not installed or not in your PATH. Please install R and try again."; \
214+
exit 1; \
215+
fi
216+
@scripts/htmlDependencies.R

docs/_quartodoc-core.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ quartodoc:
9999
- title: Custom UI
100100
desc: Lower-level UI functions for creating custom HTML/CSS/JS
101101
contents:
102+
- ui.Theme
102103
- ui.HTML # uses justattributes.rst template
103104
- ui.TagList # uses class.rst template
104105
- name: ui.tags # uses tags.rst template

docs/_quartodoc-express.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ quartodoc:
162162
- title: UI as HTML
163163
desc: Tools for creating HTML/CSS/JS
164164
contents:
165+
- express.ui.Theme
165166
- express.ui.markdown
166167
- express.ui.include_css
167168
- express.ui.include_js

0 commit comments

Comments
 (0)