From 30096590ae2ccc3d7b4a166d1040ed970c4cb2e7 Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 20 Jan 2021 08:08:15 -0600 Subject: [PATCH 1/7] Make ioslides_presentation() more themable via {bslib} and {sass} --- R/ioslides_presentation.R | 70 +- .../ioslides-13.5.1/theme/css/default.scss | 1545 +++++++++++++++++ 2 files changed, 1601 insertions(+), 14 deletions(-) create mode 100644 inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss diff --git a/R/ioslides_presentation.R b/R/ioslides_presentation.R index af8bb8264d..8abe4b2200 100644 --- a/R/ioslides_presentation.R +++ b/R/ioslides_presentation.R @@ -19,9 +19,12 @@ #' @param transition Speed of slide transitions. This can be "default", #' "slower", "faster", or a numeric value with a number of seconds (e.g. 0.5). #' @param analytics A Google analytics property ID. -#'@param smart Produce typographically correct output, converting straight -#' quotes to curly quotes, \code{---} to em-dashes, \code{--} to en-dashes, and -#' \code{...} to ellipses. +#' @param smart Produce typographically correct output, converting straight +#' quotes to curly quotes, \code{---} to em-dashes, \code{--} to en-dashes, and +#' \code{...} to ellipses. +#' @param theme a list of theming arguments (currently `bg`, `fg`, `primary`, +#' `success`, `warning`, `danger`, `base_font`, and `code_font` are supported, +#' see [bslib::bs_theme()] for more about these options) #' @return R Markdown output format to pass to \code{\link{render}}. #' @details #' See the \href{https://bookdown.org/yihui/rmarkdown/ioslides-presentation.html}{ @@ -248,6 +251,7 @@ ioslides_presentation <- function(number_sections = FALSE, md_extensions = NULL, pandoc_args = NULL, extra_dependencies = NULL, + theme = NULL, ...) { # base pandoc options for all output @@ -291,7 +295,7 @@ ioslides_presentation <- function(number_sections = FALSE, # html dependency for ioslides extra_dependencies <- append(extra_dependencies, - list(html_dependency_ioslides())) + html_dependency_ioslides(theme)) # analytics if (!is.null(analytics)) @@ -453,14 +457,16 @@ ioslides_presentation <- function(number_sections = FALSE, mathjax = mathjax, pandoc_args = pandoc_args, extra_dependencies = extra_dependencies, - bootstrap_compatible = TRUE, ...)) + bootstrap_compatible = TRUE, theme = theme, ...)) } -html_dependency_ioslides <- function() { - htmlDependency( - name = "ioslides", - version = "13.5.1", +html_dependency_ioslides <- function(theme) { + name <- "ioslides" + version <- "13.5.1" + js <- htmlDependency( + name = paste0(name, "-js"), + version = version, src = pkg_file("rmd/ioslides/ioslides-13.5.1"), script = c( "js/modernizr.custom.45394.js", @@ -470,10 +476,46 @@ html_dependency_ioslides <- function() { "js/hammer.js", "js/slide-controller.js", "js/slide-deck.js" - ), - stylesheet = c( - "fonts/fonts.css", - "theme/css/default.css", - "theme/css/phone.css") ) + ) + + if (is.null(theme)) { + css <- htmlDependency( + name = paste0(name, "-css"), + version = version, + src = pkg_file("rmd/ioslides/ioslides-13.5.1"), + stylesheet = c( + "fonts/fonts.css", + "theme/css/default.css", + "theme/css/phone.css" + ) + ) + return(list(js, css)) + } + + theme <- as_bs_theme(theme) + if (!is_bs_theme(theme)) { + stop("`theme` must be a `bslib::bs_theme()` object or a list of arguments to it") + } + if ("3" %in% theme_version(theme)) { + stop("`ioslides_presentation()` is not compatible with Bootstrap 3 (use version = 4 or higher)") + } + io_file <- function(...) { + sass::sass_file(pkg_file("rmd/ioslides/ioslides-13.5.1", ...)) + } + css <- bslib::bs_dependency( + input = sass::sass_layer( + rules = list( + io_file("fonts/fonts.css"), + io_file("theme/css/default.scss"), + io_file("theme/css/phone.css") + ), + file_attachments = c(fonts = pkg_file("rmd/ioslides/ioslides-13.5.1/fonts")) + ), + theme = theme, + name = paste0(name, "-css"), + version = version, + cache_key_extra = packageVersion("rmarkdown") + ) + list(js, css) } diff --git a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss new file mode 100644 index 0000000000..b00c0b44e1 --- /dev/null +++ b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss @@ -0,0 +1,1545 @@ +@charset "UTF-8"; + +// Variable names are based on Bootstrap 4's so this can be compiled against +// a theme and have it "just work". +// TODO: right now font-size is hard coded, but should probably respect Bootstrap vars + +$white: #fff !default; +$black: #000 !default; +$gray-100: mix($white, $black, 90%) !default; +$gray-800: mix($white, $black, 20%) !default; + +$primary: #4387fd !default; +$primary1: lighten($primary, 5%) !default; +$primary2: darken($primary, 5%) !default; + +$danger: #f44a3f !default; +$danger1: lighten($danger, 5%) !default; +$danger2: darken($danger, 5%) !default; + +$warning: #ffd14d !default; +$warning1: lighten($warning, 5%) !default; +$warning2: darken($warning, 5%) !default; + +$success: #0da861 !default; +$success1: lighten($success, 5%) !default; +$success2: darken($success, 5%) !default; + + +/* line 17, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + vertical-align: baseline; +} + +/* line 22, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +html { + line-height: 1.2; +} + +/* line 24, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +ul { + list-style: none; +} + +/* line 26, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* line 28, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +caption, th, td { + font-weight: normal; + vertical-align: middle; +} + +/* line 30, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +q, blockquote { + quotes: none; +} +/* line 103, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +q:before, q:after, blockquote:before, blockquote:after { + content: ""; + content: none; +} + +/* line 32, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +a img { + border: none; +} + +/* line 116, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ +article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { + display: block; +} + +/** + * Base SlideDeck Styles + */ +/* line 52, ../scss/_base.scss */ +html { + height: 100%; + overflow: hidden; +} + +/* line 57, ../scss/_base.scss */ +body { + margin: 0; + padding: 0; + opacity: 0; + height: 100%; + min-height: 740px; + width: 100%; + overflow: hidden; + color: $white; + -webkit-font-smoothing: antialiased; + -moz-font-smoothing: antialiased; + -ms-font-smoothing: antialiased; + -o-font-smoothing: antialiased; + -webkit-transition: opacity 250ms ease-in; + -webkit-transition-delay: 100ms; + -moz-transition: opacity 250ms ease-in 100ms; + -o-transition: opacity 250ms ease-in 100ms; + transition: opacity 250ms ease-in 100ms; +} +/* line 73, ../scss/_base.scss */ +body.loaded { + opacity: 1 !important; +} + +/* line 78, ../scss/_base.scss */ +input, button { + vertical-align: middle; +} + +/* line 82, ../scss/_base.scss */ +slides > slide[hidden] { + display: none !important; +} + +/* line 86, ../scss/_base.scss */ +slides { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + -webkit-transform: translate3d(0, 0, 0); + -moz-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + -o-perspective: 1000; + perspective: 1000; + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + -ms-transform-style: preserve-3d; + -o-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-transition: opacity 250ms ease-in; + -webkit-transition-delay: 100ms; + -moz-transition: opacity 250ms ease-in 100ms; + -o-transition: opacity 250ms ease-in 100ms; + transition: opacity 250ms ease-in 100ms; +} + +/* line 98, ../scss/_base.scss */ +slides > slide { + display: block; + position: absolute; + overflow: hidden; + left: 50%; + top: 50%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* Slide styles */ +/*article.fill iframe { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + + border: 0; + margin: 0; + + @include border-radius(10px); + + z-index: -1; +} + +slide.fill { + background-repeat: no-repeat; + @include background-size(cover); +} + +slide.fill img { + position: absolute; + left: 0; + top: 0; + min-width: 100%; + min-height: 100%; + + z-index: -1; +} +*/ +/** + * Theme Styles + */ +/* line 22, ../scss/default.scss */ +::selection { + color: $white; + background-color: $warning; + text-shadow: none; +} + +/* line 28, ../scss/default.scss */ +::-webkit-scrollbar { + height: 16px; + overflow: visible; + width: 16px; +} + +/* line 33, ../scss/default.scss */ +::-webkit-scrollbar-thumb { + background-color: rgba($black, 0.1); + background-clip: padding-box; + border: solid transparent; + min-height: 28px; + padding: 100px 0 0; + -webkit-box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); + -moz-box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); + box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); + border-width: 1px 1px 1px 6px; +} + +/* line 42, ../scss/default.scss */ +::-webkit-scrollbar-thumb:hover { + background-color: rgba($black, 0.5); +} + +/* line 45, ../scss/default.scss */ +::-webkit-scrollbar-button { + height: 0; + width: 0; +} + +/* line 49, ../scss/default.scss */ +::-webkit-scrollbar-track { + background-clip: padding-box; + border: solid transparent; + border-width: 0 0 0 4px; +} + +/* line 54, ../scss/default.scss */ +::-webkit-scrollbar-corner { + background: transparent; +} + +/* line 58, ../scss/default.scss */ +body { + background: $black; +} + +/* line 62, ../scss/default.scss */ +slides > slide { + color: mix($white, $black, 47.5%); + width: 900px; + height: 700px; + margin-left: -450px; + margin-top: -350px; + padding: 40px 60px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; + border-radius: 5px; + -webkit-transition: all 0.6s ease-in-out; + -moz-transition: all 0.6s ease-in-out; + -o-transition: all 0.6s ease-in-out; + transition: all 0.6s ease-in-out; +} +/* line 83, ../scss/default.scss */ +slides > slide.far-past { +} +/* line 90, ../scss/default.scss */ +slides > slide.past { + opacity: 0; +} +/* line 97, ../scss/default.scss */ +slides > slide.current { + display: block; + opacity: 1; + z-index: 1; +} +slides > slide:not(.current) { + z-index: 0; +} +/* line 103, ../scss/default.scss */ +slides > slide.current .auto-fadein { + opacity: 1; +} +/* line 107, ../scss/default.scss */ +slides > slide.current .gdbar { + -webkit-background-size: 100% 100%; + -moz-background-size: 100% 100%; + -o-background-size: 100% 100%; + background-size: 100% 100%; +} +/* line 112, ../scss/default.scss */ +slides > slide.next { + opacity: 0; + pointer-events: none; +} +/* line 120, ../scss/default.scss */ +slides > slide.far-next { +} +/* line 127, ../scss/default.scss */ +slides > slide.dark { + background: mix($white, $black, 32%) !important; +} + +/* line 147, ../scss/default.scss */ +slides > slide:not(.nobackground):after { + font-size: 12pt; + content: attr(data-slide-num) "/" attr(data-total-slides); + position: absolute; + bottom: 20px; + right: 60px; + line-height: 1.9; +} +/* line 158, ../scss/default.scss */ +slides > slide.title-slide:after { + content: ''; + position: absolute; + bottom: 40px; + right: 40px; + width: 100%; + height: 60px; +} +/* line 170, ../scss/default.scss */ +slides > slide.backdrop { + z-index: -10; + display: block !important; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($white, $white 85%, $gray-100); + background: -moz-linear-gradient($white, $white 85%, $gray-100); + background: -o-linear-gradient($white, $white 85%, $gray-100); + background: linear-gradient($white, $white 85%, $gray-100); + background-color: $white; +} +/* line 175, ../scss/default.scss */ +slides > slide.backdrop:after, slides > slide.backdrop:before { + display: none; +} +/* line 180, ../scss/default.scss */ +slides > slide > hgroup + article { + margin-top: 45px; +} +/* line 184, ../scss/default.scss */ +slides > slide > hgroup + article.flexbox.vcenter, slides > slide > hgroup + article.flexbox.vleft, slides > slide > hgroup + article.flexbox.vright { + height: 80%; +} +/* line 189, ../scss/default.scss */ +slides > slide > hgroup + article p { + margin-bottom: 1em; +} +/* line 194, ../scss/default.scss */ +slides > slide > article:only-child { + height: 100%; +} +/* line 197, ../scss/default.scss */ +slides > slide > article:only-child > iframe { + height: 95%; +} + +/* line 203, ../scss/default.scss */ +slides.layout-faux-widescreen > slide { + padding: 40px 160px; +} + +/* line 212, ../scss/default.scss */ +slides.layout-widescreen > slide, +slides.layout-faux-widescreen > slide { + margin-left: -550px; + width: 1100px; +} +/* line 217, ../scss/default.scss */ +slides.layout-widescreen > slide.far-past, +slides.layout-faux-widescreen > slide.far-past { + -webkit-transform: translate(-2260px); + -moz-transform: translate(-2260px); + -ms-transform: translate(-2260px); + -o-transform: translate(-2260px); + transform: translate(-2260px); + -webkit-transform: translate3d(-2260px, 0, 0); + -moz-transform: translate3d(-2260px, 0, 0); + -ms-transform: translate3d(-2260px, 0, 0); + -o-transform: translate3d(-2260px, 0, 0); + transform: translate3d(-2260px, 0, 0); +} +/* line 224, ../scss/default.scss */ +slides.layout-widescreen > slide.past, +slides.layout-faux-widescreen > slide.past { + display: block; + opacity: 0; +} +/* line 231, ../scss/default.scss */ +slides.layout-widescreen > slide.current, +slides.layout-faux-widescreen > slide.current { + display: block; + opacity: 1; +} +/* line 238, ../scss/default.scss */ +slides.layout-widescreen > slide.next, +slides.layout-faux-widescreen > slide.next { + display: block; + opacity: 0; + pointer-events: none; +} +/* line 246, ../scss/default.scss */ +slides.layout-widescreen > slide.far-next, +slides.layout-faux-widescreen > slide.far-next { + -webkit-transform: translate(2260px); + -moz-transform: translate(2260px); + -ms-transform: translate(2260px); + -o-transform: translate(2260px); + transform: translate(2260px); + -webkit-transform: translate3d(2260px, 0, 0); + -moz-transform: translate3d(2260px, 0, 0); + -ms-transform: translate3d(2260px, 0, 0); + -o-transform: translate3d(2260px, 0, 0); + transform: translate3d(2260px, 0, 0); +} +/* line 253, ../scss/default.scss */ +slides.layout-widescreen #prev-slide-area, +slides.layout-faux-widescreen #prev-slide-area { + margin-left: -650px; +} +/* line 257, ../scss/default.scss */ +slides.layout-widescreen #next-slide-area, +slides.layout-faux-widescreen #next-slide-area { + margin-left: 550px; +} + +/* line 262, ../scss/default.scss */ +b { + font-weight: 600; +} + +/* line 266, ../scss/default.scss */ +a { + color: $primary2; + text-decoration: none; + border-bottom: 1px solid rgba($primary2, 0.5); +} +/* line 271, ../scss/default.scss */ +a:hover { + color: $black !important; +} + +/* line 276, ../scss/default.scss */ +h1, h2, h3 { + font-weight: 600; +} + +/* line 280, ../scss/default.scss */ +h2 { + font-size: 45px; + line-height: 65px; + letter-spacing: -2px; + color: mix($white, $black, 32%); +} + +/* line 287, ../scss/default.scss */ +h3 { + font-size: 30px; + letter-spacing: -1px; + line-height: 2; + font-weight: inherit; + color: mix($white, $black, 47.5%); +} + +/* line 295, ../scss/default.scss */ +ol, ul { + margin-left: 1.2em; + margin-bottom: 1em; + position: relative; +} + +ol { + margin-left: 1.4em; +} + +/* line 300, ../scss/default.scss */ +ol li, +ul li { + margin-bottom: 0.5em; +} +/* line 303, ../scss/default.scss */ +ul li ul { + margin-left: 2em; + margin-bottom: 0; +} +/* line 307, ../scss/default.scss */ +ul li ul li:before { + content: '-'; + font-weight: 600; +} +/* line 314, ../scss/default.scss */ +ul > li:before { + content: '\00B7'; + margin-left: -1em; + position: absolute; + font-weight: 600; +} +/* line 321, ../scss/default.scss */ +ul ul, +ol ul { + margin-top: .5em; +} + +ol ul, +ol ol { + margin-top: .5em; +} + +/* line 328, ../scss/default.scss */ +.highlight-code slide.current pre > * { + opacity: 0.25; + -webkit-transition: opacity 0.5s ease-in; + -moz-transition: opacity 0.5s ease-in; + -o-transition: opacity 0.5s ease-in; + transition: opacity 0.5s ease-in; +} +/* line 332, ../scss/default.scss */ +.highlight-code slide.current b { + opacity: 1; +} + +/* line 337, ../scss/default.scss */ +pre { + font-size: 20px; + line-height: 28px; + padding: 10px 0 10px 60px; + letter-spacing: -1px; + margin-bottom: 20px; + width: 106%; + left: -60px; + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + /*overflow: hidden;*/ +} + +.prettyprint { + background-color: $gray-100; +} + +/* line 351, ../scss/default.scss */ +pre[data-lang]:after { + content: attr(data-lang); + background-color: mix($white, $black, 66.7%); + right: 0; + top: 0; + position: absolute; + font-size: 16pt; + color: $white; + padding: 2px 25px; + text-transform: uppercase; +} + +/* line 364, ../scss/default.scss */ +pre[data-lang="go"] { + color: $gray-800; +} + +/* line 368, ../scss/default.scss */ +code { + font-size: 95%; + font-family: 'Source Code Pro', 'Courier New', monospace; + color: $black; +} + +/* line 374, ../scss/default.scss */ +iframe { + width: 100%; + height: 510px; + background: $white; + border: 1px solid $gray-100; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* line 382, ../scss/default.scss */ +dt { + font-weight: bold; +} + +/* line 386, ../scss/default.scss */ +button { + display: inline-block; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($white, $black, 97.5%)), color-stop(70%, mix($white, $black, 89%))); + background: -webkit-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); + background: -moz-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); + background: -o-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); + background: linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); + border: 1px solid mix($white, $black, 66%); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -ms-border-radius: 3px; + -o-border-radius: 3px; + border-radius: 3px; + padding: 5px 8px; + outline: none; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: pointer; + text-shadow: 1px 1px $white; + font-size: 10pt; +} + +/* line 400, ../scss/default.scss */ +button:not(:disabled):hover { + border-color: mix($white, $black, 32%); +} + +/* line 404, ../scss/default.scss */ +button:not(:disabled):active { + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($white, $black, 89%)), color-stop(70%, mix($white, $black, 97.5%))); + background: -webkit-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); + background: -moz-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); + background: -o-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); + background: linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); +} + +/* line 408, ../scss/default.scss */ +:disabled { + color: mix($white, $black, 66%); +} + +/* line 412, ../scss/default.scss */ +.blue { + color: $primary; +} + +/* line 415, ../scss/default.scss */ +.blue2 { + color: $primary1; +} + +/* line 418, ../scss/default.scss */ +.blue3 { + color: $primary2; +} + +/* line 421, ../scss/default.scss */ +.yellow { + color: $warning; +} + +/* line 424, ../scss/default.scss */ +.yellow2 { + color: $warning1; +} + +/* line 427, ../scss/default.scss */ +.yellow3 { + color: $warning2; +} + +/* line 430, ../scss/default.scss */ +.green { + color: $success; +} + +/* line 433, ../scss/default.scss */ +.green2 { + color: $success1; +} + +/* line 436, ../scss/default.scss */ +.green3 { + color: $success2; +} + +/* line 439, ../scss/default.scss */ +.red { + color: $danger; +} + +/* line 442, ../scss/default.scss */ +.red2 { + color: $danger1; +} + +/* line 445, ../scss/default.scss */ +.red3 { + color: $danger2; +} + +/* line 448, ../scss/default.scss */ +.gray { + color: $gray-100; +} + +/* line 451, ../scss/default.scss */ +.gray2 { + color: mix($white, $black, 66%); +} + +/* line 454, ../scss/default.scss */ +.gray3 { + color: mix($white, $black, 47.5%); +} + +/* line 457, ../scss/default.scss */ +.gray4 { + color: mix($white, $black, 32%); +} + +/* line 461, ../scss/default.scss */ +.white { + color: $white !important; +} + +/* line 464, ../scss/default.scss */ +.black { + color: $black !important; +} + +/* line 468, ../scss/default.scss */ +.columns-2 { + -webkit-column-count: 2; + -moz-column-count: 2; + -ms-column-count: 2; + -o-column-count: 2; + column-count: 2; +} + +/* workaround for Safari 8 render bug with lists in columns */ +.columns-2 ul, .columns-2 ol { + -webkit-transform: translate3d(0, 0, 0); +} + +/* line 472, ../scss/default.scss */ +table.rmdtable { + width: 100%; + border-collapse: -moz-initial; + border-collapse: initial; + border-spacing: 2px; + border-bottom: 1px solid mix($white, $black, 47.5%); +} +/* line 479, ../scss/default.scss */ +table.rmdtable tr > td:first-child, table th { + font-weight: 600; + color: mix($white, $black, 32%); +} +/* line 484, ../scss/default.scss */ +table.rmdtable tr:nth-child(odd) { + background-color: $gray-100; +} +/* line 488, ../scss/default.scss */ +table.rmdtable th { + color: $white; + font-size: 18px; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, $primary), color-stop(80%, $primary2)) no-repeat; + background: -webkit-linear-gradient(top, $primary 40%, $primary2 80%) no-repeat; + background: -moz-linear-gradient(top, $primary 40%, $primary2 80%) no-repeat; + background: -o-linear-gradient(top, $primary 40%, $primary2 80%) no-repeat; + background: linear-gradient(top, $primary 40%, $primary2 80%) no-repeat; +} +/* line 494, ../scss/default.scss */ +table.rmdtable td, table th { + font-size: 18px; + padding: 1em 0.5em; +} +/* line 499, ../scss/default.scss */ +table.rmdtable td.highlight { + color: mix($white, $black, 32%); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, $warning), color-stop(80%, $warning2)) no-repeat; + background: -webkit-linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; + background: -moz-linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; + background: -o-linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; + background: linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; +} +/* line 504, ../scss/default.scss */ +table.rmdtable.rows { + border-bottom: none; + border-right: 1px solid mix($white, $black, 47.5%); +} + +/* line 510, ../scss/default.scss */ +q { + font-size: 45px; + line-height: 72px; +} +/* line 514, ../scss/default.scss */ +q:before { + content: '\201C'; + position: absolute; + margin-left: -0.5em; +} +/* line 519, ../scss/default.scss */ +q:after { + content: '\201D'; + position: absolute; + margin-left: 0.1em; +} + +/* line 526, ../scss/default.scss */ +slide.fill { + background-repeat: no-repeat; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; + border-radius: 5px; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +/* Size variants */ +/* line 535, ../scss/default.scss */ +article.smaller p, article.smaller ul, article.smaller ol { + font-size: 20px; + line-height: 24px; + letter-spacing: 0; +} +/* line 541, ../scss/default.scss */ +article.smaller table td, article.smaller table th { + font-size: 14px; +} +/* line 545, ../scss/default.scss */ +article.smaller pre { + font-size: 15px; + line-height: 20px; + letter-spacing: 0; +} +/* line 550, ../scss/default.scss */ +article.smaller q { + font-size: 40px; + line-height: 48px; +} +/* line 554, ../scss/default.scss */ +article.smaller q:before, article.smaller q:after { + font-size: 60px; +} + +/* Builds */ +/* line 563, ../scss/default.scss */ +.build > * { + -webkit-transition: opacity 0.5s ease-in-out; + -webkit-transition-delay: 0.2s; + -moz-transition: opacity 0.5s ease-in-out 0.2s; + -o-transition: opacity 0.5s ease-in-out 0.2s; + transition: opacity 0.5s ease-in-out 0.2s; +} +/* line 567, ../scss/default.scss */ +.build .to-build { + opacity: 0; +} +/* line 571, ../scss/default.scss */ +.build .build-fade { + opacity: 0.3; +} +/* line 574, ../scss/default.scss */ +.build .build-fade:hover { + opacity: 1.0; +} + +/* line 581, ../scss/default.scss */ +.popup .next .build .to-build { + opacity: 1; +} +/* line 585, ../scss/default.scss */ +.popup .next .build .build-fade { + opacity: 1; +} + +/* Pretty print */ +/* line 593, ../scss/default.scss */ +.prettyprint .str, +.prettyprint .atv { + /* a markup attribute value */ + color: $success2; +} + +/* line 597, ../scss/default.scss */ +.prettyprint .kwd, +.prettyprint .tag { + /* a markup tag name */ + color: #0066cc; +} + +/* line 600, ../scss/default.scss */ +.prettyprint .com { + /* a comment */ + color: mix($white, $black, 47.5%); + font-style: italic; +} + +/* line 604, ../scss/default.scss */ +.prettyprint .lit { + /* a literal value */ + color: #7f0000; +} + +/* line 609, ../scss/default.scss */ +.prettyprint .pun, +.prettyprint .opn, +.prettyprint .clo { + color: mix($white, $black, 32%); +} + +/* line 615, ../scss/default.scss */ +.prettyprint .typ, +.prettyprint .atn, +.prettyprint .dec, +.prettyprint .var { + /* a declaration; a variable name */ + color: $danger2; +} + +/* line 618, ../scss/default.scss */ +.prettyprint .pln { + color: mix($white, $black, 32%); +} + +/* line 622, ../scss/default.scss */ +.note { + position: absolute; + z-index: 100; + width: 100%; + height: 100%; + top: 0; + left: 0; + padding: 1em; + background: rgba($black, 0.3); + opacity: 0; + pointer-events: none; + display: -webkit-box !important; + display: -moz-box !important; + display: -ms-box !important; + display: -o-box !important; + display: box !important; + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: center; + -moz-box-align: center; + -ms-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + -ms-box-pack: center; + box-pack: center; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; + border-radius: 5px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-transform: translateY(350px); + -moz-transform: translateY(350px); + -ms-transform: translateY(350px); + -o-transform: translateY(350px); + transform: translateY(350px); + -webkit-transition: all 0.4s ease-in-out; + -moz-transition: all 0.4s ease-in-out; + -o-transition: all 0.4s ease-in-out; + transition: all 0.4s ease-in-out; +} +/* line 640, ../scss/default.scss */ +.note > section { + background: $white; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; + border-radius: 5px; + -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); + -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); + box-shadow: 0 0 10px mix($white, $black, 47.5%); + width: 60%; + padding: 2em; +} + +/* line 657, ../scss/default.scss */ +.with-notes.popup slides.layout-widescreen slide.next, +.with-notes.popup slides.layout-faux-widescreen slide.next { + -webkit-transform: translate3d(690px, 80px, 0) scale(0.35); + -moz-transform: translate3d(690px, 80px, 0) scale(0.35); + -ms-transform: translate3d(690px, 80px, 0) scale(0.35); + -o-transform: translate3d(690px, 80px, 0) scale(0.35); + transform: translate3d(690px, 80px, 0) scale(0.35); +} +/* line 660, ../scss/default.scss */ +.with-notes.popup slides.layout-widescreen slide .note, +.with-notes.popup slides.layout-faux-widescreen slide .note { + -webkit-transform: translate3d(300px, 800px, 0) scale(1.5); + -moz-transform: translate3d(300px, 800px, 0) scale(1.5); + -ms-transform: translate3d(300px, 800px, 0) scale(1.5); + -o-transform: translate3d(300px, 800px, 0) scale(1.5); + transform: translate3d(300px, 800px, 0) scale(1.5); +} +/* line 666, ../scss/default.scss */ +.with-notes.popup slide { + overflow: visible; + background: $white; + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; + pointer-events: none; + -webkit-transform-origin: 0 0; + -moz-transform-origin: 0 0; + -ms-transform-origin: 0 0; + -o-transform-origin: 0 0; + transform-origin: 0 0; +} +/* line 673, ../scss/default.scss */ +.with-notes.popup slide:not(.backdrop) { + -webkit-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); + -moz-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); + -ms-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); + -o-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); + transform: scale(0.6) translate3d(0.5em, 0.5em, 0); + -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); + -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); + box-shadow: 0 0 10px mix($white, $black, 47.5%); +} +/* line 678, ../scss/default.scss */ +.with-notes.popup slide.backdrop { + background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 600, color-stop(0%, #b1dfff), color-stop(100%, $primary)); + background-image: -webkit-radial-gradient(50% 50%, #b1dfff 0%, $primary 600px); + background-image: -moz-radial-gradient(50% 50%, #b1dfff 0%, $primary 600px); + background-image: -o-radial-gradient(50% 50%, #b1dfff 0%, $primary 600px); + background-image: radial-gradient(50% 50%, #b1dfff 0%, $primary 600px); +} +/* line 684, ../scss/default.scss */ +.with-notes.popup slide.next { + -webkit-transform: translate3d(570px, 80px, 0) scale(0.35); + -moz-transform: translate3d(570px, 80px, 0) scale(0.35); + -ms-transform: translate3d(570px, 80px, 0) scale(0.35); + -o-transform: translate3d(570px, 80px, 0) scale(0.35); + transform: translate3d(570px, 80px, 0) scale(0.35); + opacity: 1 !important; +} +/* line 688, ../scss/default.scss */ +.with-notes.popup slide.next .note { + display: none !important; +} +/* line 694, ../scss/default.scss */ +.with-notes.popup .note { + width: 109%; + height: 260px; + background: $gray-100; + padding: 0; + -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); + -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); + box-shadow: 0 0 10px mix($white, $black, 47.5%); + -webkit-transform: translate3d(250px, 800px, 0) scale(1.5); + -moz-transform: translate3d(250px, 800px, 0) scale(1.5); + -ms-transform: translate3d(250px, 800px, 0) scale(1.5); + -o-transform: translate3d(250px, 800px, 0) scale(1.5); + transform: translate3d(250px, 800px, 0) scale(1.5); + -webkit-transition: opacity 400ms ease-in-out; + -moz-transition: opacity 400ms ease-in-out; + -o-transition: opacity 400ms ease-in-out; + transition: opacity 400ms ease-in-out; +} +/* line 705, ../scss/default.scss */ +.with-notes.popup .note > section { + background: $white; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + -ms-border-radius: 5px; + -o-border-radius: 5px; + border-radius: 5px; + height: 100%; + width: 100%; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + overflow: auto; + padding: 1em; +} +/* line 718, ../scss/default.scss */ +.with-notes .note { + opacity: 1; + -webkit-transform: translateY(0); + -moz-transform: translateY(0); + -ms-transform: translateY(0); + -o-transform: translateY(0); + transform: translateY(0); + pointer-events: auto; +} + +/* line 725, ../scss/default.scss */ +.source { + font-size: 14px; + color: mix($white, $black, 66%); + position: absolute; + bottom: 70px; + left: 60px; +} + +/* line 733, ../scss/default.scss */ +.centered { + text-align: center; +} + +/* line 737, ../scss/default.scss */ +.reflect { + -webkit-box-reflect: below 3px -webkit-linear-gradient(rgba($white, 0) 85%, $white 150%); + -moz-box-reflect: below 3px -moz-linear-gradient(rgba($white, 0) 85%, $white 150%); + -o-box-reflect: below 3px -o-linear-gradient(rgba($white, 0) 85%, $white 150%); + -ms-box-reflect: below 3px -ms-linear-gradient(rgba($white, 0) 85%, $white 150%); + box-reflect: below 3px linear-gradient(rgba($white, 0) 85%, $white 150%); +} + +/* line 745, ../scss/default.scss */ +.flexbox { + display: -webkit-box !important; + display: -moz-box !important; + display: -ms-box !important; + display: -o-box !important; + display: box !important; +} + +/* line 749, ../scss/default.scss */ +.flexbox.vcenter { + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: center; + -moz-box-align: center; + -ms-box-align: center; + box-align: center; + -webkit-box-pack: center; + -moz-box-pack: center; + -ms-box-pack: center; + box-pack: center; + height: 100%; + width: 100%; +} + +/* line 755, ../scss/default.scss */ +.flexbox.vleft { + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: left; + -moz-box-align: left; + -ms-box-align: left; + box-align: left; + -webkit-box-pack: center; + -moz-box-pack: center; + -ms-box-pack: center; + box-pack: center; + height: 100%; + width: 100%; +} + +/* line 761, ../scss/default.scss */ +.flexbox.vright { + -webkit-box-orient: vertical; + -moz-box-orient: vertical; + -ms-box-orient: vertical; + box-orient: vertical; + -webkit-box-align: end; + -moz-box-align: end; + -ms-box-align: end; + box-align: end; + -webkit-box-pack: center; + -moz-box-pack: center; + -ms-box-pack: center; + box-pack: center; + height: 100%; + width: 100%; +} + +/* line 767, ../scss/default.scss */ +.auto-fadein { + -webkit-transition: opacity 0.6s ease-in; + -webkit-transition-delay: 0.6s; + -moz-transition: opacity 0.6s ease-in 0.6s; + -o-transition: opacity 0.6s ease-in 0.6s; + transition: opacity 0.6s ease-in 0.6s; + opacity: 0; +} + +/* Clickable/tappable areas */ +/* line 773, ../scss/default.scss */ +.slide-area { + z-index: 1000; + position: absolute; + left: 0; + top: 0; + width: 100px; + height: 700px; + left: 50%; + top: 50%; + cursor: pointer; + margin-top: -350px; +} + +/* line 790, ../scss/default.scss */ +#prev-slide-area { + margin-left: -550px; +} + +/* line 795, ../scss/default.scss */ +#next-slide-area { + margin-left: 450px; +} + +/* ===== SLIDE CONTENT ===== */ +/* line 803, ../scss/default.scss */ +.logoslide img { + width: 383px; + height: 92px; +} + +/* line 809, ../scss/default.scss */ +.segue { + padding: 60px 120px; +} +/* line 812, ../scss/default.scss */ +.segue h2 { + color: $gray-100; + font-size: 60px; +} +/* line 816, ../scss/default.scss */ +.segue h3 { + color: $gray-100; + line-height: 2.8; +} +/* line 820, ../scss/default.scss */ +.segue hgroup { + position: absolute; + bottom: 225px; +} + +/* line 826, ../scss/default.scss */ +.thank-you-slide { + background: $primary !important; + color: $white; +} +/* line 830, ../scss/default.scss */ +.thank-you-slide h2 { + font-size: 60px; + color: inherit; +} +/* line 835, ../scss/default.scss */ +.thank-you-slide article > p { + margin-top: 2em; + font-size: 20pt; +} +/* line 840, ../scss/default.scss */ +.thank-you-slide > p { + position: absolute; + bottom: 80px; + font-size: 24pt; + line-height: 1.3; +} + +/* line 848, ../scss/default.scss */ +aside.gdbar { + height: 97px; + width: 215px; + position: absolute; + left: -1px; + top: 125px; + -webkit-border-radius: 0 10px 10px 0; + -moz-border-radius: 0 10px 10px 0; + -ms-border-radius: 0 10px 10px 0; + -o-border-radius: 0 10px 10px 0; + border-radius: 0 10px 10px 0; + background: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, $gray-100), color-stop(100%, $gray-100)) no-repeat; + background: -webkit-linear-gradient(left, $gray-100, $gray-100) no-repeat; + background: -moz-linear-gradient(left, $gray-100, $gray-100) no-repeat; + background: -o-linear-gradient(left, $gray-100, $gray-100) no-repeat; + background: linear-gradient(left, $gray-100, $gray-100) no-repeat; + -webkit-background-size: 0% 100%; + -moz-background-size: 0% 100%; + -o-background-size: 0% 100%; + background-size: 0% 100%; + -webkit-transition: all 0.5s ease-out; + -webkit-transition-delay: 0.5s; + -moz-transition: all 0.5s ease-out 0.5s; + -o-transition: all 0.5s ease-out 0.5s; + transition: all 0.5s ease-out 0.5s; + /* Better to transition only on background-size, but not sure how to do that with the mixin. */ +} +/* line 859, ../scss/default.scss */ +aside.gdbar.right { + right: 0; + left: -moz-initial; + left: initial; + top: 254px; + /* 96 is height of gray icon bar */ + -webkit-transform: rotateZ(180deg); + -moz-transform: rotateZ(180deg); + -ms-transform: rotateZ(180deg); + -o-transform: rotateZ(180deg); + transform: rotateZ(180deg); +} +/* line 866, ../scss/default.scss */ +aside.gdbar.right img { + -webkit-transform: rotateZ(180deg); + -moz-transform: rotateZ(180deg); + -ms-transform: rotateZ(180deg); + -o-transform: rotateZ(180deg); + transform: rotateZ(180deg); +} +/* line 871, ../scss/default.scss */ +aside.gdbar.bottom { + top: -moz-initial; + top: initial; + bottom: 60px; +} +/* line 877, ../scss/default.scss */ +aside.gdbar img { + width: 85px; + height: 85px; + position: absolute; + right: 0; + margin: 8px 15px; +} + +/* line 888, ../scss/default.scss */ +.title-slide hgroup { + bottom: 100px; +} +/* line 891, ../scss/default.scss */ +.title-slide hgroup h1 { + font-size: 65px; + line-height: 1.4; + letter-spacing: -3px; + color: mix($white, $black, 32%); +} +/* line 898, ../scss/default.scss */ +.title-slide hgroup h2 { + font-size: 34px; + color: mix($white, $black, 66%); + font-weight: inherit; +} +/* line 904, ../scss/default.scss */ +.title-slide hgroup p { + font-size: 20px; + color: mix($white, $black, 47.5%); + line-height: 1.3; + margin-top: 2em; +} + +/* line 913, ../scss/default.scss */ +.quote { + color: $gray-100; +} +/* line 916, ../scss/default.scss */ +.quote .author { + font-size: 24px; + position: absolute; + bottom: 80px; + line-height: 1.4; +} + +/* line 925, ../scss/default.scss */ +[data-config-contact] a { + color: $white; + border-bottom: none; +} +/* line 929, ../scss/default.scss */ +[data-config-contact] span { + width: 115px; + display: inline-block; +} + +/* line 938, ../scss/default.scss */ +.overview.popup .note { + display: none !important; +} +/* line 944, ../scss/default.scss */ +.overview slides slide { + display: block; + cursor: pointer; + opacity: 0.5; + pointer-events: auto !important; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($white, $white 85%, $gray-100); + background: -moz-linear-gradient($white, $white 85%, $gray-100); + background: -o-linear-gradient($white, $white 85%, $gray-100); + background: linear-gradient($white, $white 85%, $gray-100); + background-color: $white; +} +/* line 945, ../scss/default.scss */ +.overview slides slide.backdrop { + display: none !important; +} +/* line 960, ../scss/default.scss */ +.overview slides slide.far-past, .overview slides slide.past, .overview slides slide.next, .overview slides slide.far-next, .overview slides slide.far-past { + opacity: 0.5; + display: block; +} +/* line 965, ../scss/default.scss */ +.overview slides slide.current { + opacity: 1; +} +/* line 971, ../scss/default.scss */ +.overview .slide-area { + display: none; +} + +slides > slide { + background: linear-gradient($white, $white 85%, $gray-100); + background-color: $white; +} +slides > slide { + opacity: 0; +} + +@media print { + /* Additions for printing with Headless Chrome using pagedown::chrome_print() */ + @page { + size: landscape; + margin: 0; + } + + /* line 978, ../scss/default.scss */ + slides slide { + display: block !important; + position: relative; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($white, $white 85%, $gray-100); + background: -moz-linear-gradient($white, $white 85%, $gray-100); + background: -o-linear-gradient($white, $white 85%, $gray-100); + background: linear-gradient($white, $white 85%, $gray-100); + background-color: $white; + -webkit-transform: none !important; + -moz-transform: none !important; + -ms-transform: none !important; + -o-transform: none !important; + transform: none !important; + width: 100%; + height: 100%; + page-break-after: always; + top: auto !important; + left: auto !important; + margin-top: 0 !important; + margin-left: 0 !important; + opacity: 1 !important; + color: mix($white, $black, 33.3%); + } + /* line 998, ../scss/default.scss */ + slides slide.far-past, slides slide.past, slides slide.next, slides slide.far-next, slides slide.far-past, slides slide.current { + opacity: 1 !important; + display: block !important; + } + /* line 1004, ../scss/default.scss */ + slides slide .build > * { + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; + } + /* line 1009, ../scss/default.scss */ + slides slide .build .to-build, + slides slide .build .build-fade { + opacity: 1; + } + /* line 1014, ../scss/default.scss */ + slides slide .auto-fadein { + opacity: 1 !important; + } + /* line 1018, ../scss/default.scss */ + slides slide.backdrop { + display: none !important; + } + /* line 1022, ../scss/default.scss */ + slides slide table.rows { + border-right: 0; + } + /* line 1027, ../scss/default.scss */ + slides slide[hidden] { + display: none !important; + } + + /* line 1032, ../scss/default.scss */ + .slide-area { + display: none; + } + + /* line 1036, ../scss/default.scss */ + .reflect { + -webkit-box-reflect: none; + -moz-box-reflect: none; + -o-box-reflect: none; + -ms-box-reflect: none; + box-reflect: none; + } + + /* line 1044, ../scss/default.scss */ + pre, code { + font-family: monospace !important; + } +} + +/* Additions for Shiny compatibility */ +label { + display: block; + margin-bottom: 4px; +} +label, input { + font-size: 16px; + color: $gray-800; +} +input { + width: 220px; +} +.jslider { + margin-top: 8px; +} + +/* Additions for DT package */ + +.dataTables_info, .dataTables_paginate { + font-size: 14px; +} + \ No newline at end of file From 116907cb57d4c9dfa8d617d5ec6a9c1e3627d18b Mon Sep 17 00:00:00 2001 From: Carson Date: Wed, 20 Jan 2021 14:40:39 -0600 Subject: [PATCH 2/7] Make code font-family inherit from font-family-monospace --- inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss | 6 ++++-- man/ioslides_presentation.Rd | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss index b00c0b44e1..5ace49b950 100644 --- a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss +++ b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss @@ -25,6 +25,8 @@ $success: #0da861 !default; $success1: lighten($success, 5%) !default; $success2: darken($success, 5%) !default; +$font-family-monospace: 'Source Code Pro', 'Courier New', monospace !default; + /* line 17, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ html, body, div, span, applet, object, iframe, @@ -579,7 +581,7 @@ pre[data-lang="go"] { /* line 368, ../scss/default.scss */ code { font-size: 95%; - font-family: 'Source Code Pro', 'Courier New', monospace; + font-family: $font-family-monospace; color: $black; } @@ -1517,7 +1519,7 @@ slides > slide { /* line 1044, ../scss/default.scss */ pre, code { - font-family: monospace !important; + font-family: $font-family-monospace !important; } } diff --git a/man/ioslides_presentation.Rd b/man/ioslides_presentation.Rd index 65f3c0021f..02068cb217 100644 --- a/man/ioslides_presentation.Rd +++ b/man/ioslides_presentation.Rd @@ -30,6 +30,7 @@ ioslides_presentation( md_extensions = NULL, pandoc_args = NULL, extra_dependencies = NULL, + theme = NULL, ... ) } @@ -128,6 +129,10 @@ additional details.} \item{extra_dependencies}{Additional function arguments to pass to the base R Markdown HTML output formatter \code{\link{html_document_base}}} +\item{theme}{a list of theming arguments (currently `bg`, `fg`, `primary`, +`success`, `warning`, `danger`, `base_font`, and `code_font` are supported, +see [bslib::bs_theme()] for more about these options)} + \item{...}{Additional function arguments to pass to the base R Markdown HTML output formatter \code{\link{html_document_base}}} } From 50d178a46f302e56c478ca7e0cfd6240f9a3b12d Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 4 Feb 2021 09:26:24 -0600 Subject: [PATCH 3/7] make code-color configurable, update news and version --- DESCRIPTION | 2 +- NEWS.md | 2 ++ inst/rmd/h/highlightjs/default.scss | 21 +++++++++++++++++++ .../ioslides-13.5.1/theme/css/default.scss | 3 ++- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 inst/rmd/h/highlightjs/default.scss diff --git a/DESCRIPTION b/DESCRIPTION index bb17193009..04fe662cec 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rmarkdown Type: Package Title: Dynamic Documents for R -Version: 2.6.6 +Version: 2.6.7 Authors@R: c( person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"), person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")), diff --git a/NEWS.md b/NEWS.md index 5dd5419694..ffe9a65668 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,8 @@ rmarkdown 2.7 - Files with `.scss`/`.sass` extension (i.e., Sass files) provided to `html_document`'s `css` parameter are now compiled to CSS using the `{sass}` package. Also, if `theme` is a `{bslib}` object, these Sass files may utilize Sass code inside the `theme` (thanks, @cpsievert, #1706) +- ` ioslides_presentation` gains an (explicit) `theme` argument with support for `bslib::bs_theme()` objects/arguments, meaning that one may opt-into Bootstrap 4 and more easily create custom themes. For examples, see (thanks, @cpsievert, #2013) + - Fix an issue with line numbering in code chunks when `.numberlines` with Pandoc's highlighting (thanks, @aosavi, #1876) - Fix an issue with shiny runtime and `global.R` (thanks, @liaojiahui-r, rstudio/flexdashboard#298) diff --git a/inst/rmd/h/highlightjs/default.scss b/inst/rmd/h/highlightjs/default.scss new file mode 100644 index 0000000000..026360c921 --- /dev/null +++ b/inst/rmd/h/highlightjs/default.scss @@ -0,0 +1,21 @@ +.hljs-literal { + color: $blue; +} + +.hljs-number { + color: $blue; +} + +.hljs-comment { + color: $gray-500; + font-style: italic; +} + +.hljs-keyword { + color: $blue; + font-weight: bold; +} + +.hljs-string { + color: $green; +} diff --git a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss index 5ace49b950..28a6eb374f 100644 --- a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss +++ b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss @@ -26,6 +26,7 @@ $success1: lighten($success, 5%) !default; $success2: darken($success, 5%) !default; $font-family-monospace: 'Source Code Pro', 'Courier New', monospace !default; +$code-color: $black !default; /* line 17, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ @@ -582,7 +583,7 @@ pre[data-lang="go"] { code { font-size: 95%; font-family: $font-family-monospace; - color: $black; + color: $code-color; } /* line 374, ../scss/default.scss */ From d0b53c2b04accae142247132e35183f8faded875 Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 4 Feb 2021 09:31:02 -0600 Subject: [PATCH 4/7] Use resolve_theme() to determine if bslib is relevant --- R/ioslides_presentation.R | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/R/ioslides_presentation.R b/R/ioslides_presentation.R index 8abe4b2200..3d7e8b2658 100644 --- a/R/ioslides_presentation.R +++ b/R/ioslides_presentation.R @@ -479,7 +479,8 @@ html_dependency_ioslides <- function(theme) { ) ) - if (is.null(theme)) { + theme <- resolve_theme(theme) + if (!is_bs_theme(theme)) { css <- htmlDependency( name = paste0(name, "-css"), version = version, @@ -493,10 +494,6 @@ html_dependency_ioslides <- function(theme) { return(list(js, css)) } - theme <- as_bs_theme(theme) - if (!is_bs_theme(theme)) { - stop("`theme` must be a `bslib::bs_theme()` object or a list of arguments to it") - } if ("3" %in% theme_version(theme)) { stop("`ioslides_presentation()` is not compatible with Bootstrap 3 (use version = 4 or higher)") } From 7403afcea05e7f2f3b5388facb47f5a9dfb07dff Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 4 Feb 2021 09:49:39 -0600 Subject: [PATCH 5/7] For better bootswatch compatibility, cascade defaults based on body-bg and body-color --- .../ioslides-13.5.1/theme/css/default.scss | 186 +++++++++--------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss index 28a6eb374f..1a15dfc2bd 100644 --- a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss +++ b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss @@ -4,10 +4,10 @@ // a theme and have it "just work". // TODO: right now font-size is hard coded, but should probably respect Bootstrap vars -$white: #fff !default; -$black: #000 !default; -$gray-100: mix($white, $black, 90%) !default; -$gray-800: mix($white, $black, 20%) !default; +$body-bg: #fff !default; +$body-color: #000 !default; +$gray-100: mix($body-bg, $body-color, 90%); +$gray-800: mix($body-bg, $body-color, 20%); $primary: #4387fd !default; $primary1: lighten($primary, 5%) !default; @@ -26,7 +26,7 @@ $success1: lighten($success, 5%) !default; $success2: darken($success, 5%) !default; $font-family-monospace: 'Source Code Pro', 'Courier New', monospace !default; -$code-color: $black !default; +$code-color: $body-color !default; /* line 17, ../../../../../../Library/Ruby/Gems/1.8/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */ @@ -109,7 +109,7 @@ body { min-height: 740px; width: 100%; overflow: hidden; - color: $white; + color: $body-bg; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -ms-font-smoothing: antialiased; @@ -212,7 +212,7 @@ slide.fill img { */ /* line 22, ../scss/default.scss */ ::selection { - color: $white; + color: $body-bg; background-color: $warning; text-shadow: none; } @@ -226,20 +226,20 @@ slide.fill img { /* line 33, ../scss/default.scss */ ::-webkit-scrollbar-thumb { - background-color: rgba($black, 0.1); + background-color: rgba($body-color, 0.1); background-clip: padding-box; border: solid transparent; min-height: 28px; padding: 100px 0 0; - -webkit-box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); - -moz-box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); - box-shadow: inset 1px 1px 0 rgba($black, 0.1), inset 0 -1px 0 rgba($black, 0.07); + -webkit-box-shadow: inset 1px 1px 0 rgba($body-color, 0.1), inset 0 -1px 0 rgba($body-color, 0.07); + -moz-box-shadow: inset 1px 1px 0 rgba($body-color, 0.1), inset 0 -1px 0 rgba($body-color, 0.07); + box-shadow: inset 1px 1px 0 rgba($body-color, 0.1), inset 0 -1px 0 rgba($body-color, 0.07); border-width: 1px 1px 1px 6px; } /* line 42, ../scss/default.scss */ ::-webkit-scrollbar-thumb:hover { - background-color: rgba($black, 0.5); + background-color: rgba($body-color, 0.5); } /* line 45, ../scss/default.scss */ @@ -262,12 +262,12 @@ slide.fill img { /* line 58, ../scss/default.scss */ body { - background: $black; + background: $body-color; } /* line 62, ../scss/default.scss */ slides > slide { - color: mix($white, $black, 47.5%); + color: mix($body-bg, $body-color, 47.5%); width: 900px; height: 700px; margin-left: -450px; @@ -320,7 +320,7 @@ slides > slide.far-next { } /* line 127, ../scss/default.scss */ slides > slide.dark { - background: mix($white, $black, 32%) !important; + background: mix($body-bg, $body-color, 32%) !important; } /* line 147, ../scss/default.scss */ @@ -345,12 +345,12 @@ slides > slide.title-slide:after { slides > slide.backdrop { z-index: -10; display: block !important; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($white, $white 85%, $gray-100); - background: -moz-linear-gradient($white, $white 85%, $gray-100); - background: -o-linear-gradient($white, $white 85%, $gray-100); - background: linear-gradient($white, $white 85%, $gray-100); - background-color: $white; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background-color: $body-bg; } /* line 175, ../scss/default.scss */ slides > slide.backdrop:after, slides > slide.backdrop:before { @@ -459,7 +459,7 @@ a { } /* line 271, ../scss/default.scss */ a:hover { - color: $black !important; + color: $body-color !important; } /* line 276, ../scss/default.scss */ @@ -472,7 +472,7 @@ h2 { font-size: 45px; line-height: 65px; letter-spacing: -2px; - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 287, ../scss/default.scss */ @@ -481,7 +481,7 @@ h3 { letter-spacing: -1px; line-height: 2; font-weight: inherit; - color: mix($white, $black, 47.5%); + color: mix($body-bg, $body-color, 47.5%); } /* line 295, ../scss/default.scss */ @@ -564,12 +564,12 @@ pre { /* line 351, ../scss/default.scss */ pre[data-lang]:after { content: attr(data-lang); - background-color: mix($white, $black, 66.7%); + background-color: mix($body-bg, $body-color, 66.7%); right: 0; top: 0; position: absolute; font-size: 16pt; - color: $white; + color: $body-bg; padding: 2px 25px; text-transform: uppercase; } @@ -590,7 +590,7 @@ code { iframe { width: 100%; height: 510px; - background: $white; + background: $body-bg; border: 1px solid $gray-100; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -605,12 +605,12 @@ dt { /* line 386, ../scss/default.scss */ button { display: inline-block; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($white, $black, 97.5%)), color-stop(70%, mix($white, $black, 89%))); - background: -webkit-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); - background: -moz-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); - background: -o-linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); - background: linear-gradient(mix($white, $black, 97.5%) 40%, mix($white, $black, 89%) 70%); - border: 1px solid mix($white, $black, 66%); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($body-bg, $body-color, 97.5%)), color-stop(70%, mix($body-bg, $body-color, 89%))); + background: -webkit-linear-gradient(mix($body-bg, $body-color, 97.5%) 40%, mix($body-bg, $body-color, 89%) 70%); + background: -moz-linear-gradient(mix($body-bg, $body-color, 97.5%) 40%, mix($body-bg, $body-color, 89%) 70%); + background: -o-linear-gradient(mix($body-bg, $body-color, 97.5%) 40%, mix($body-bg, $body-color, 89%) 70%); + background: linear-gradient(mix($body-bg, $body-color, 97.5%) 40%, mix($body-bg, $body-color, 89%) 70%); + border: 1px solid mix($body-bg, $body-color, 66%); -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; @@ -623,27 +623,27 @@ button { -moz-user-select: none; user-select: none; cursor: pointer; - text-shadow: 1px 1px $white; + text-shadow: 1px 1px $body-bg; font-size: 10pt; } /* line 400, ../scss/default.scss */ button:not(:disabled):hover { - border-color: mix($white, $black, 32%); + border-color: mix($body-bg, $body-color, 32%); } /* line 404, ../scss/default.scss */ button:not(:disabled):active { - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($white, $black, 89%)), color-stop(70%, mix($white, $black, 97.5%))); - background: -webkit-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); - background: -moz-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); - background: -o-linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); - background: linear-gradient(mix($white, $black, 89%) 40%, mix($white, $black, 97.5%) 70%); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, mix($body-bg, $body-color, 89%)), color-stop(70%, mix($body-bg, $body-color, 97.5%))); + background: -webkit-linear-gradient(mix($body-bg, $body-color, 89%) 40%, mix($body-bg, $body-color, 97.5%) 70%); + background: -moz-linear-gradient(mix($body-bg, $body-color, 89%) 40%, mix($body-bg, $body-color, 97.5%) 70%); + background: -o-linear-gradient(mix($body-bg, $body-color, 89%) 40%, mix($body-bg, $body-color, 97.5%) 70%); + background: linear-gradient(mix($body-bg, $body-color, 89%) 40%, mix($body-bg, $body-color, 97.5%) 70%); } /* line 408, ../scss/default.scss */ :disabled { - color: mix($white, $black, 66%); + color: mix($body-bg, $body-color, 66%); } /* line 412, ../scss/default.scss */ @@ -713,27 +713,27 @@ button:not(:disabled):active { /* line 451, ../scss/default.scss */ .gray2 { - color: mix($white, $black, 66%); + color: mix($body-bg, $body-color, 66%); } /* line 454, ../scss/default.scss */ .gray3 { - color: mix($white, $black, 47.5%); + color: mix($body-bg, $body-color, 47.5%); } /* line 457, ../scss/default.scss */ .gray4 { - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 461, ../scss/default.scss */ .white { - color: $white !important; + color: $body-bg !important; } /* line 464, ../scss/default.scss */ .black { - color: $black !important; + color: $body-color !important; } /* line 468, ../scss/default.scss */ @@ -756,12 +756,12 @@ table.rmdtable { border-collapse: -moz-initial; border-collapse: initial; border-spacing: 2px; - border-bottom: 1px solid mix($white, $black, 47.5%); + border-bottom: 1px solid mix($body-bg, $body-color, 47.5%); } /* line 479, ../scss/default.scss */ table.rmdtable tr > td:first-child, table th { font-weight: 600; - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 484, ../scss/default.scss */ table.rmdtable tr:nth-child(odd) { @@ -769,7 +769,7 @@ table.rmdtable tr:nth-child(odd) { } /* line 488, ../scss/default.scss */ table.rmdtable th { - color: $white; + color: $body-bg; font-size: 18px; background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, $primary), color-stop(80%, $primary2)) no-repeat; background: -webkit-linear-gradient(top, $primary 40%, $primary2 80%) no-repeat; @@ -784,7 +784,7 @@ table.rmdtable td, table th { } /* line 499, ../scss/default.scss */ table.rmdtable td.highlight { - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(40%, $warning), color-stop(80%, $warning2)) no-repeat; background: -webkit-linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; background: -moz-linear-gradient(top, $warning 40%, $warning2 80%) no-repeat; @@ -794,7 +794,7 @@ table.rmdtable td.highlight { /* line 504, ../scss/default.scss */ table.rmdtable.rows { border-bottom: none; - border-right: 1px solid mix($white, $black, 47.5%); + border-right: 1px solid mix($body-bg, $body-color, 47.5%); } /* line 510, ../scss/default.scss */ @@ -905,7 +905,7 @@ article.smaller q:before, article.smaller q:after { /* line 600, ../scss/default.scss */ .prettyprint .com { /* a comment */ - color: mix($white, $black, 47.5%); + color: mix($body-bg, $body-color, 47.5%); font-style: italic; } @@ -919,7 +919,7 @@ article.smaller q:before, article.smaller q:after { .prettyprint .pun, .prettyprint .opn, .prettyprint .clo { - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 615, ../scss/default.scss */ @@ -933,7 +933,7 @@ article.smaller q:before, article.smaller q:after { /* line 618, ../scss/default.scss */ .prettyprint .pln { - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 622, ../scss/default.scss */ @@ -945,7 +945,7 @@ article.smaller q:before, article.smaller q:after { top: 0; left: 0; padding: 1em; - background: rgba($black, 0.3); + background: rgba($body-color, 0.3); opacity: 0; pointer-events: none; display: -webkit-box !important; @@ -985,15 +985,15 @@ article.smaller q:before, article.smaller q:after { } /* line 640, ../scss/default.scss */ .note > section { - background: $white; + background: $body-bg; -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; - -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); - -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); - box-shadow: 0 0 10px mix($white, $black, 47.5%); + -webkit-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + -moz-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); width: 60%; padding: 2em; } @@ -1019,7 +1019,7 @@ article.smaller q:before, article.smaller q:after { /* line 666, ../scss/default.scss */ .with-notes.popup slide { overflow: visible; - background: $white; + background: $body-bg; -webkit-transition: none; -moz-transition: none; -o-transition: none; @@ -1038,9 +1038,9 @@ article.smaller q:before, article.smaller q:after { -ms-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); -o-transform: scale(0.6) translate3d(0.5em, 0.5em, 0); transform: scale(0.6) translate3d(0.5em, 0.5em, 0); - -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); - -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); - box-shadow: 0 0 10px mix($white, $black, 47.5%); + -webkit-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + -moz-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); } /* line 678, ../scss/default.scss */ .with-notes.popup slide.backdrop { @@ -1069,9 +1069,9 @@ article.smaller q:before, article.smaller q:after { height: 260px; background: $gray-100; padding: 0; - -webkit-box-shadow: 0 0 10px mix($white, $black, 47.5%); - -moz-box-shadow: 0 0 10px mix($white, $black, 47.5%); - box-shadow: 0 0 10px mix($white, $black, 47.5%); + -webkit-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + -moz-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); + box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); -webkit-transform: translate3d(250px, 800px, 0) scale(1.5); -moz-transform: translate3d(250px, 800px, 0) scale(1.5); -ms-transform: translate3d(250px, 800px, 0) scale(1.5); @@ -1084,7 +1084,7 @@ article.smaller q:before, article.smaller q:after { } /* line 705, ../scss/default.scss */ .with-notes.popup .note > section { - background: $white; + background: $body-bg; -webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; @@ -1115,7 +1115,7 @@ article.smaller q:before, article.smaller q:after { /* line 725, ../scss/default.scss */ .source { font-size: 14px; - color: mix($white, $black, 66%); + color: mix($body-bg, $body-color, 66%); position: absolute; bottom: 70px; left: 60px; @@ -1128,11 +1128,11 @@ article.smaller q:before, article.smaller q:after { /* line 737, ../scss/default.scss */ .reflect { - -webkit-box-reflect: below 3px -webkit-linear-gradient(rgba($white, 0) 85%, $white 150%); - -moz-box-reflect: below 3px -moz-linear-gradient(rgba($white, 0) 85%, $white 150%); - -o-box-reflect: below 3px -o-linear-gradient(rgba($white, 0) 85%, $white 150%); - -ms-box-reflect: below 3px -ms-linear-gradient(rgba($white, 0) 85%, $white 150%); - box-reflect: below 3px linear-gradient(rgba($white, 0) 85%, $white 150%); + -webkit-box-reflect: below 3px -webkit-linear-gradient(rgba($body-bg, 0) 85%, $body-bg 150%); + -moz-box-reflect: below 3px -moz-linear-gradient(rgba($body-bg, 0) 85%, $body-bg 150%); + -o-box-reflect: below 3px -o-linear-gradient(rgba($body-bg, 0) 85%, $body-bg 150%); + -ms-box-reflect: below 3px -ms-linear-gradient(rgba($body-bg, 0) 85%, $body-bg 150%); + box-reflect: below 3px linear-gradient(rgba($body-bg, 0) 85%, $body-bg 150%); } /* line 745, ../scss/default.scss */ @@ -1263,7 +1263,7 @@ article.smaller q:before, article.smaller q:after { /* line 826, ../scss/default.scss */ .thank-you-slide { background: $primary !important; - color: $white; + color: $body-bg; } /* line 830, ../scss/default.scss */ .thank-you-slide h2 { @@ -1356,18 +1356,18 @@ aside.gdbar img { font-size: 65px; line-height: 1.4; letter-spacing: -3px; - color: mix($white, $black, 32%); + color: mix($body-bg, $body-color, 32%); } /* line 898, ../scss/default.scss */ .title-slide hgroup h2 { font-size: 34px; - color: mix($white, $black, 66%); + color: mix($body-bg, $body-color, 66%); font-weight: inherit; } /* line 904, ../scss/default.scss */ .title-slide hgroup p { font-size: 20px; - color: mix($white, $black, 47.5%); + color: mix($body-bg, $body-color, 47.5%); line-height: 1.3; margin-top: 2em; } @@ -1386,7 +1386,7 @@ aside.gdbar img { /* line 925, ../scss/default.scss */ [data-config-contact] a { - color: $white; + color: $body-bg; border-bottom: none; } /* line 929, ../scss/default.scss */ @@ -1405,12 +1405,12 @@ aside.gdbar img { cursor: pointer; opacity: 0.5; pointer-events: auto !important; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($white, $white 85%, $gray-100); - background: -moz-linear-gradient($white, $white 85%, $gray-100); - background: -o-linear-gradient($white, $white 85%, $gray-100); - background: linear-gradient($white, $white 85%, $gray-100); - background-color: $white; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background-color: $body-bg; } /* line 945, ../scss/default.scss */ .overview slides slide.backdrop { @@ -1431,8 +1431,8 @@ aside.gdbar img { } slides > slide { - background: linear-gradient($white, $white 85%, $gray-100); - background-color: $white; + background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background-color: $body-bg; } slides > slide { opacity: 0; @@ -1449,12 +1449,12 @@ slides > slide { slides slide { display: block !important; position: relative; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $white), color-stop(85%, $white), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($white, $white 85%, $gray-100); - background: -moz-linear-gradient($white, $white 85%, $gray-100); - background: -o-linear-gradient($white, $white 85%, $gray-100); - background: linear-gradient($white, $white 85%, $gray-100); - background-color: $white; + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background-color: $body-bg; -webkit-transform: none !important; -moz-transform: none !important; -ms-transform: none !important; @@ -1468,7 +1468,7 @@ slides > slide { margin-top: 0 !important; margin-left: 0 !important; opacity: 1 !important; - color: mix($white, $black, 33.3%); + color: mix($body-bg, $body-color, 33.3%); } /* line 998, ../scss/default.scss */ slides slide.far-past, slides slide.past, slides slide.next, slides slide.far-next, slides slide.far-past, slides slide.current { From fd331ac0af18e148d9602aabe7531464638f72a4 Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 4 Feb 2021 10:44:40 -0600 Subject: [PATCH 6/7] Make ioslides 'dynamically' themeable --- R/ioslides_presentation.R | 16 +++-- .../ioslides-13.5.1/theme/css/default.scss | 66 +++++++++---------- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/R/ioslides_presentation.R b/R/ioslides_presentation.R index 3d7e8b2658..88ca7b769f 100644 --- a/R/ioslides_presentation.R +++ b/R/ioslides_presentation.R @@ -293,9 +293,17 @@ ioslides_presentation <- function(number_sections = FALSE, template <- pkg_file("rmd/ioslides/default.html") args <- c(args, "--template", pandoc_path_arg(template)) - # html dependency for ioslides - extra_dependencies <- append(extra_dependencies, - html_dependency_ioslides(theme)) + # Add ioslides HTML dependencies + # If bslib is relevant, we want to register a _deferred_ version of the CSS dependency so + # it can update in response to Shiny's session$setCurrentTheme() (e.g., bslib::bs_themer()) + # https://rstudio.github.io/bslib/articles/theming.html#dynamic-theming-in-shiny + theme <- resolve_theme(theme) + if (is_bs_theme(theme)) { + dynamic_ioslides <- bslib::bs_dependency_defer(html_dependency_ioslides) + theme <- bslib::bs_bundle(theme, sass::sass_layer(html_deps = dynamic_ioslides)) + } else { + extra_dependencies <- append(extra_dependencies, html_dependency_ioslides(theme)) + } # analytics if (!is.null(analytics)) @@ -461,7 +469,7 @@ ioslides_presentation <- function(number_sections = FALSE, } -html_dependency_ioslides <- function(theme) { +html_dependency_ioslides <- function(theme = NULL) { name <- "ioslides" version <- "13.5.1" js <- htmlDependency( diff --git a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss index 1a15dfc2bd..c2bcc4a09c 100644 --- a/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss +++ b/inst/rmd/ioslides/ioslides-13.5.1/theme/css/default.scss @@ -6,8 +6,8 @@ $body-bg: #fff !default; $body-color: #000 !default; -$gray-100: mix($body-bg, $body-color, 90%); -$gray-800: mix($body-bg, $body-color, 20%); +$body-100: mix($body-bg, $body-color, 90%) !default; +$body-800: mix($body-bg, $body-color, 20%) !default; $primary: #4387fd !default; $primary1: lighten($primary, 5%) !default; @@ -345,11 +345,11 @@ slides > slide.title-slide:after { slides > slide.backdrop { z-index: -10; display: block !important; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $body-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: linear-gradient($body-bg, $body-bg 85%, $body-100); background-color: $body-bg; } /* line 175, ../scss/default.scss */ @@ -558,7 +558,7 @@ pre { } .prettyprint { - background-color: $gray-100; + background-color: $body-100; } /* line 351, ../scss/default.scss */ @@ -576,7 +576,7 @@ pre[data-lang]:after { /* line 364, ../scss/default.scss */ pre[data-lang="go"] { - color: $gray-800; + color: $body-800; } /* line 368, ../scss/default.scss */ @@ -591,7 +591,7 @@ iframe { width: 100%; height: 510px; background: $body-bg; - border: 1px solid $gray-100; + border: 1px solid $body-100; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; @@ -708,7 +708,7 @@ button:not(:disabled):active { /* line 448, ../scss/default.scss */ .gray { - color: $gray-100; + color: $body-100; } /* line 451, ../scss/default.scss */ @@ -765,7 +765,7 @@ table.rmdtable tr > td:first-child, table th { } /* line 484, ../scss/default.scss */ table.rmdtable tr:nth-child(odd) { - background-color: $gray-100; + background-color: $body-100; } /* line 488, ../scss/default.scss */ table.rmdtable th { @@ -1067,7 +1067,7 @@ article.smaller q:before, article.smaller q:after { .with-notes.popup .note { width: 109%; height: 260px; - background: $gray-100; + background: $body-100; padding: 0; -webkit-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); -moz-box-shadow: 0 0 10px mix($body-bg, $body-color, 47.5%); @@ -1246,12 +1246,12 @@ article.smaller q:before, article.smaller q:after { } /* line 812, ../scss/default.scss */ .segue h2 { - color: $gray-100; + color: $body-100; font-size: 60px; } /* line 816, ../scss/default.scss */ .segue h3 { - color: $gray-100; + color: $body-100; line-height: 2.8; } /* line 820, ../scss/default.scss */ @@ -1295,11 +1295,11 @@ aside.gdbar { -ms-border-radius: 0 10px 10px 0; -o-border-radius: 0 10px 10px 0; border-radius: 0 10px 10px 0; - background: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, $gray-100), color-stop(100%, $gray-100)) no-repeat; - background: -webkit-linear-gradient(left, $gray-100, $gray-100) no-repeat; - background: -moz-linear-gradient(left, $gray-100, $gray-100) no-repeat; - background: -o-linear-gradient(left, $gray-100, $gray-100) no-repeat; - background: linear-gradient(left, $gray-100, $gray-100) no-repeat; + background: -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, $body-100), color-stop(100%, $body-100)) no-repeat; + background: -webkit-linear-gradient(left, $body-100, $body-100) no-repeat; + background: -moz-linear-gradient(left, $body-100, $body-100) no-repeat; + background: -o-linear-gradient(left, $body-100, $body-100) no-repeat; + background: linear-gradient(left, $body-100, $body-100) no-repeat; -webkit-background-size: 0% 100%; -moz-background-size: 0% 100%; -o-background-size: 0% 100%; @@ -1374,7 +1374,7 @@ aside.gdbar img { /* line 913, ../scss/default.scss */ .quote { - color: $gray-100; + color: $body-100; } /* line 916, ../scss/default.scss */ .quote .author { @@ -1405,11 +1405,11 @@ aside.gdbar img { cursor: pointer; opacity: 0.5; pointer-events: auto !important; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $body-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: linear-gradient($body-bg, $body-bg 85%, $body-100); background-color: $body-bg; } /* line 945, ../scss/default.scss */ @@ -1431,7 +1431,7 @@ aside.gdbar img { } slides > slide { - background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: linear-gradient($body-bg, $body-bg 85%, $body-100); background-color: $body-bg; } slides > slide { @@ -1449,11 +1449,11 @@ slides > slide { slides slide { display: block !important; position: relative; - background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $gray-100)); - background: -webkit-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -moz-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: -o-linear-gradient($body-bg, $body-bg 85%, $gray-100); - background: linear-gradient($body-bg, $body-bg 85%, $gray-100); + background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, $body-bg), color-stop(85%, $body-bg), color-stop(100%, $body-100)); + background: -webkit-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -moz-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: -o-linear-gradient($body-bg, $body-bg 85%, $body-100); + background: linear-gradient($body-bg, $body-bg 85%, $body-100); background-color: $body-bg; -webkit-transform: none !important; -moz-transform: none !important; @@ -1531,7 +1531,7 @@ label { } label, input { font-size: 16px; - color: $gray-800; + color: $body-800; } input { width: 220px; From 3e81227d4380c8b6a8e7a1d89bd6b329e3d53041 Mon Sep 17 00:00:00 2001 From: Carson Date: Thu, 4 Feb 2021 11:03:05 -0600 Subject: [PATCH 7/7] Accidentally committed a wip file --- inst/rmd/h/highlightjs/default.scss | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 inst/rmd/h/highlightjs/default.scss diff --git a/inst/rmd/h/highlightjs/default.scss b/inst/rmd/h/highlightjs/default.scss deleted file mode 100644 index 026360c921..0000000000 --- a/inst/rmd/h/highlightjs/default.scss +++ /dev/null @@ -1,21 +0,0 @@ -.hljs-literal { - color: $blue; -} - -.hljs-number { - color: $blue; -} - -.hljs-comment { - color: $gray-500; - font-style: italic; -} - -.hljs-keyword { - color: $blue; - font-weight: bold; -} - -.hljs-string { - color: $green; -}