Save JSON representation of HTML dependencies & underlying Sass code #915
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.
This PR is motivated by Quarto (which already takes a build-time dependency on bslib to copy over it's modified version of Bootstrap) wanting to leverage even more work that we're doing in Sass (especially the
bs_theme(preset="shiny")
).The main idea/addition here is a new
inst/css-precompiled/5/dependencies.json
file that Quarto can ingest to:bs3compat
also comes with JS assets (those assets would make it soshiny::tabsetPanel()
, which produces BS3 markup, works correctly in Quarto)builtin
.Other, more general, things Quarto should be aware of:
dependencies.json
are relative to bslib'sinst/
directory.sass_layer()
features that probably don't exist in Quarto, such asfile_attachments
, which are essentially just extra files/directories that get imported inside the Sass code/files.all_files = TRUE
, which mounts the entire{src: file: {}}
directory atname-version
. This what makes things like source map files available and the$web-font-path: "font.css"
trick thatbuiltin
andbootswatch
themes leverage to implement local file requests (in that case, there is a@import font.css
which makes a request to font files under thefont/
directory).BTW, there are, what seems to be a lot of R/scss changes in this PR, but it's mostly just shuffling logic around so it's more centralized and simpler to get a
sass_bundle()
representation ofbs_theme()
that is just 4 layers:bootstrap
,bslib
,bs3compat
, andbuiltin
.