-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save a dependencies.json that captures all bs_theme() (+ component-sp…
…ecific) HTML dependencies as well as the Sass layers used to generate the relevant CSS
Showing
16 changed files
with
426 additions
and
305 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,9 @@ | ||
// Our own Sass variables that we use in our rules | ||
$bootstrap-version: null !default; // Should always be brought in via R | ||
$bslib-preset-name: null !default; | ||
$bslib-preset-type: null !default; | ||
|
||
|
||
|
||
// Bootstrap Sass defaults that we take advantage of | ||
$enable-cssgrid: true !default; |
This file contains 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,156 @@ | ||
:root { | ||
// "Global" theming information | ||
--bslib-bootstrap-version: #{$bootstrap-version}; | ||
--bslib-preset-name: #{$bslib-preset-name}; | ||
--bslib-preset-type: #{$bslib-preset-type}; | ||
// Controls default spacing in layout containers (e.g, layout_columns()) | ||
--bslib-spacer: #{$spacer}; | ||
--bslib-mb-spacer: var(--bslib-spacer, 1rem); | ||
} | ||
|
||
// **************************************************************************** | ||
// Spacing utilities for bslib components | ||
// | ||
// Some things like card(), p(), inputs, etc. want some margin-bottom by default | ||
// so you can plop them anywhere and you get spacing between rows. However, now | ||
// that we have layout utilities like page_fillable(), layout_columns(), | ||
// layout_sidebar(), etc. where we can control the gap between rows/columns, we | ||
// need a way to reset those margin-bottom to 0 in those special contexts | ||
// | ||
// We do this by adding .bslib-mb-spacing to components like card() | ||
// **************************************************************************** | ||
|
||
.bslib-mb-spacing { | ||
margin-bottom: var(--bslib-mb-spacer); | ||
} | ||
|
||
// ...And this class for layout containers (e.g, layout_columns()) | ||
.bslib-gap-spacing { | ||
gap: var(--bslib-mb-spacer); | ||
> .bslib-mb-spacing, > .form-group, > p, > pre { | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
// We generally don't want mb spacing for _activated_ fill items | ||
.html-fill-container > .html-fill-item.bslib-mb-spacing { | ||
margin-bottom: 0; | ||
} | ||
|
||
|
||
// **************************************************************************** | ||
// Workaround for pkgdown's CSS to make tab-pane all a consistent height | ||
// which negatively impacts filling content in tabs | ||
// https://github.com/r-lib/pkgdown/blob/956f07/inst/BS5/assets/pkgdown.scss#L342-L355 | ||
// **************************************************************************** | ||
|
||
.tab-content { | ||
>.tab-pane.html-fill-container { | ||
display: none; | ||
} | ||
|
||
// Take precedence over Bootstrap's `display:block` rule | ||
>.active.html-fill-container { | ||
display: flex; | ||
} | ||
|
||
// Another workaround for pkgdown adding extra padding we didn't ask for | ||
// https://github.com/r-lib/pkgdown/blob/956f07/inst/BS5/assets/pkgdown.scss#L335-L337 | ||
&.html-fill-container { | ||
padding: 0; | ||
} | ||
} | ||
|
||
|
||
// **************************************************************************** | ||
// Override Bootstrap's table reboot rules which negatively impacts pandoc | ||
// tables (which use the align attribute to align content) | ||
// **************************************************************************** | ||
|
||
.table { | ||
th[align=left] { text-align: left; } | ||
th[align=right] { text-align: right; } | ||
th[align=center] { text-align: center; } | ||
} | ||
|
||
// **************************************************************************** | ||
// Add more .bg-*, .text-*, as well as .bg-gradient-*-* utility classes. | ||
// | ||
// These are primarily here for `value_box(theme = "bg-purple")`, but might be | ||
// more generally useful. | ||
// **************************************************************************** | ||
|
||
$bslib-enable-color-utilities: $bootstrap-version >= 5 !default; | ||
|
||
@if ($bslib-enable-color-utilities) { | ||
$bslib-gradient-colors: () !default; | ||
|
||
$bslib-gradient-colors-defaults: (); | ||
$bslib-color-names: ("blue", "indigo", "purple", "pink", "red", "orange", "yellow", "green", "teal", "cyan"); | ||
|
||
@each $name in $bslib-color-names { | ||
@if (map-has-key($colors, $name)) { | ||
$bslib-gradient-colors-defaults: map-merge( | ||
$bslib-gradient-colors-defaults, | ||
($name: map-get($colors, $name)) | ||
); | ||
} | ||
} | ||
|
||
$bslib-gradient-colors: map-merge( | ||
$bslib-gradient-colors-defaults, | ||
$bslib-gradient-colors | ||
); | ||
|
||
// Named color background and foreground utility classes --------------------- | ||
@each $name, $color in $bslib-gradient-colors { | ||
.bg-#{$name} { | ||
--bslib-color-bg: #{$color}; | ||
--bslib-color-fg: #{color-contrast($color)}; | ||
background-color: var(--bslib-color-bg); | ||
color: var(--bslib-color-fg); | ||
} | ||
|
||
.text-#{$name} { | ||
--bslib-color-fg: #{$color}; | ||
color: var(--bslib-color-fg); | ||
} | ||
} | ||
|
||
// Fill in the `--color-*` variables | ||
@each $name, $color in $theme-colors { | ||
.text-#{$name} { | ||
--bslib-color-fg: #{$color}; | ||
} | ||
.bg-#{$name} { | ||
--bslib-color-bg: #{$color}; | ||
--bslib-color-fg: #{color-contrast($color)}; | ||
} | ||
} | ||
|
||
// Gradient backgrounds ------------------------------------------------------ | ||
// | ||
// Creates gradient background for every named color pair. Users can add | ||
// additional colors into the mix by setting $bslib-gradient-colors to a map of | ||
// color names to colors. Creates class names like: .bg-gradient-{from}-{to}. | ||
@each $name1, $color1 in $bslib-gradient-colors { | ||
@each $name2, $color2 in $bslib-gradient-colors { | ||
@if $name1 != $name2 { | ||
.bg-gradient-#{$name1}-#{$name2} { | ||
$color-mid: mix($color1, $color2, 60%); | ||
$color-fg: color-contrast($color-mid); | ||
|
||
--bslib-color-fg: #{$color-fg}; | ||
--bslib-color-bg: #{$color-mid}; | ||
|
||
background: linear-gradient( | ||
var(--bg-gradient-deg, 140deg), | ||
$color1 var(--bg-gradient-start, 36%), | ||
$color2 var(--bg-gradient-end, 180%) | ||
) $color-mid; | ||
color: $color-fg; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,96 @@ | ||
[ | ||
{ | ||
"name": "jquery", | ||
"version": "3.6.0", | ||
"src": { | ||
"file": "/Users/cpsievert/R/4.3/jquerylib/lib/3.6.0" | ||
}, | ||
"script": "jquery-3.6.0.min.js", | ||
"all_files": true | ||
}, | ||
{ | ||
"name": "bootstrap", | ||
"version": "5.3.1", | ||
"src": { | ||
"file": "/var/folders/t8/jxw4bftj35g15fcb6m4mfbc80000gn/T//RtmpCAptIJ/bslib-1102751e422cb" | ||
}, | ||
"meta": { | ||
"viewport": "width=device-width, initial-scale=1, shrink-to-fit=no" | ||
}, | ||
"script": "bootstrap.bundle.min.js", | ||
"stylesheet": "bootstrap.min.css", | ||
"all_files": true, | ||
"sass_layers": { | ||
"bootstrap": { | ||
"functions": "@import \"lib/bs5/scss/_functions.scss\";", | ||
"defaults": ["", "", "", "@import \"lib/bs5/scss/_variables.scss\";", "@import \"lib/bs5/scss/_variables-dark.scss\";"], | ||
"mixins": ["@import \"lib/bs5/scss/_maps.scss\";", "@import \"lib/bs5/scss/_mixins.scss\";"], | ||
"rules": ["@import \"lib/bs5/scss/mixins/_banner.scss\";", "@include bsBanner('')", "@import \"lib/bs5/scss/_utilities.scss\";", "@import \"lib/bs5/scss/_root.scss\";", "@import \"lib/bs5/scss/_reboot.scss\";", "@import \"lib/bs5/scss/_type.scss\";", "@import \"lib/bs5/scss/_images.scss\";", "@import \"lib/bs5/scss/_containers.scss\";", "@import \"lib/bs5/scss/_grid.scss\";", "@import \"lib/bs5/scss/_tables.scss\";", "@import \"lib/bs5/scss/_forms.scss\";", "@import \"lib/bs5/scss/_buttons.scss\";", "@import \"lib/bs5/scss/_transitions.scss\";", "@import \"lib/bs5/scss/_dropdown.scss\";", "@import \"lib/bs5/scss/_button-group.scss\";", "@import \"lib/bs5/scss/_nav.scss\";", "@import \"lib/bs5/scss/_navbar.scss\";", "@import \"lib/bs5/scss/_card.scss\";", "@import \"lib/bs5/scss/_accordion.scss\";", "@import \"lib/bs5/scss/_breadcrumb.scss\";", "@import \"lib/bs5/scss/_pagination.scss\";", "@import \"lib/bs5/scss/_badge.scss\";", "@import \"lib/bs5/scss/_alert.scss\";", "@import \"lib/bs5/scss/_progress.scss\";", "@import \"lib/bs5/scss/_list-group.scss\";", "@import \"lib/bs5/scss/_close.scss\";", "@import \"lib/bs5/scss/_toasts.scss\";", "@import \"lib/bs5/scss/_modal.scss\";", "@import \"lib/bs5/scss/_tooltip.scss\";", "@import \"lib/bs5/scss/_popover.scss\";", "@import \"lib/bs5/scss/_carousel.scss\";", "@import \"lib/bs5/scss/_spinners.scss\";", "@import \"lib/bs5/scss/_offcanvas.scss\";", "@import \"lib/bs5/scss/_placeholders.scss\";", "@import \"lib/bs5/scss/_helpers.scss\";", "@import \"lib/bs5/scss/utilities/_api.scss\";"] | ||
}, | ||
"bslib": { | ||
"functions": "@import \"bslib-scss/functions.scss\";", | ||
"defaults": ["$bootstrap-version: 5;", "@import \"bslib-scss/defaults.scss\";"], | ||
"rules": "@import \"bslib-scss/rules.scss\";" | ||
}, | ||
"bs3compat": { | ||
"defaults": "@import \"bs3compat/_defaults.scss\";", | ||
"mixins": "@import \"bs3compat/_declarations.scss\";", | ||
"rules": "@import \"bs3compat/_rules.scss\";", | ||
"file_attachments": "lib/bs3/assets/fonts" | ||
}, | ||
"builtin": { | ||
"defaults": ["$bslib-preset-type: builtin;", "$bslib-preset-name: shiny;", "$web-font-path: \"font.css\" !default;", "@import \"builtin/bs5/shiny/_variables.scss\";"], | ||
"mixins": "@import \"builtin/bs5/shiny/_mixins.scss\";", | ||
"rules": "@import \"builtin/bs5/shiny/_rules.scss\";", | ||
"file_attachments": ["builtin/bs5/shiny/font.css", "fonts"] | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "bs3compat", | ||
"version": "0.5.1.9000", | ||
"src": { | ||
"file": "bs3compat/js" | ||
}, | ||
"script": ["transition.js", "tabs.js", "bs3compat.js"], | ||
"all_files": true | ||
}, | ||
{ | ||
"name": "bslib-component-js", | ||
"version": "0.5.1.9000", | ||
"src": { | ||
"file": "components/dist" | ||
}, | ||
"script": [ | ||
{ | ||
"src": "components.min.js" | ||
}, | ||
{ | ||
"src": "web-components.min.js", | ||
"type": "module" | ||
} | ||
], | ||
"all_files": true | ||
}, | ||
{ | ||
"name": "bslib-component-css", | ||
"version": "0.5.1.9000", | ||
"src": { | ||
"file": "/var/folders/t8/jxw4bftj35g15fcb6m4mfbc80000gn/T//RtmpCAptIJ/bslib-component-css11027181e5294" | ||
}, | ||
"stylesheet": "bslib-component-css.min.css", | ||
"all_files": true, | ||
"sass_layer": { | ||
"bslib_components": { | ||
"mixins": "@import \"components/scss/mixins/_mixins.scss\";", | ||
"rules": ["@import \"components/scss/accordion.scss\";", "@import \"components/scss/card.scss\";", "@import \"components/scss/grid.scss\";", "@import \"components/scss/nav_spacer.scss\";", "@import \"components/scss/page_fillable.scss\";", "@import \"components/scss/page_navbar.scss\";", "@import \"components/scss/page_sidebar.scss\";", "@import \"components/scss/sidebar.scss\";", "@import \"components/scss/value_box.scss\";"] | ||
}, | ||
"bootstrap_headers": { | ||
"functions": ["@import \"lib/bs5/scss/_functions.scss\";", "@import \"bslib-scss/functions.scss\";"], | ||
"defaults": ["", "", "", "$bslib-preset-type: builtin;", "$bslib-preset-name: shiny;", "$web-font-path: \"font.css\" !default;", "@import \"builtin/bs5/shiny/_variables.scss\";", "@import \"bs3compat/_defaults.scss\";", "$bootstrap-version: 5;", "@import \"bslib-scss/defaults.scss\";", "@import \"lib/bs5/scss/_variables.scss\";", "@import \"lib/bs5/scss/_variables-dark.scss\";"], | ||
"mixins": ["@import \"lib/bs5/scss/_maps.scss\";", "@import \"lib/bs5/scss/_mixins.scss\";", "@import \"bs3compat/_declarations.scss\";", "@import \"builtin/bs5/shiny/_mixins.scss\";"], | ||
"file_attachments": ["lib/bs3/assets/fonts", "builtin/bs5/shiny/font.css", "fonts"] | ||
} | ||
} | ||
} | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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