feat: Add theme argument to page functions#1334
Merged
Conversation
Expands the carve-outs to include `Tagifiable`, `HTMLDependency`, and `list[HTMLDependency]`. This improves usability for shinyswatch, but also hides the `ThemeProvider` type behind a type alias, pushing focus on the typical `str | Path` use case.
cpsievert
reviewed
Apr 24, 2024
| "css", | ||
| ] | ||
|
|
||
| subprocess.run(args) |
Collaborator
There was a problem hiding this comment.
If purgecss isn't installed, you'll see: FileNotFoundError: [Errno 2] No such file or directory: 'purgecss'.
Probably worth a check + more informative error?
Collaborator
Author
There was a problem hiding this comment.
This isn't officially part of the example, just used to create it.
Collaborator
Author
There was a problem hiding this comment.
I added a note at the top of the file that purgecss is required and how to install it
cpsievert
reviewed
Apr 24, 2024
cpsievert
reviewed
Apr 24, 2024
cpsievert
approved these changes
Apr 24, 2024
Collaborator
cpsievert
left a comment
There was a problem hiding this comment.
Nice, thanks! Let's add an to the changelog before merging?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1270
This approach supercedes #1275 as a smaller, more targeted change. This PR:
themeargument toshiny.ui.page_()functions.themeis provided, i.e. is notNone, it represents a complete replacement for Bootstrap's CSS files.shinyswatch, theme accepts a tagifiable, or html dependency or a list of html dependencies.The scope of this PR is different from #1275 in that
themeis exclusively for the replacement of Bootstrap's CSS, all other scenarios are easily accomplished usingui.include_css()or html dependencies.If moving forward with this iteration, we also aren't going to separate the Bootstrap dependency into
bootstrap-cssandbootstrap-js. That approach is inconsistent with how we handle dependencies otherwise and possibly points to a need for anHTMLDependencyPartial.Closes #1275 (supercedes)
Closes #1282 (supercedes)