From 8a4501483f99e542cb9dca75a31a0ca2d752f61e Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Wed, 28 Jul 2021 21:48:53 +0200 Subject: [PATCH] Pin Boostrap version to 4 in bs4_book theme (#1211) --- R/bs4_book.R | 6 +++++- man/bs4_book.Rd | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/R/bs4_book.R b/R/bs4_book.R index 27854d315..53eed9d44 100644 --- a/R/bs4_book.R +++ b/R/bs4_book.R @@ -192,8 +192,12 @@ bs4_book <- function(theme = bs4_book_theme(), #' @export #' @rdname bs4_book #' @param primary Primary colour: used for links and background of footer. -bs4_book_theme <- function(primary = "#0068D9", ...) { +#' @param version Passed to [bslib::bs_theme()]. This should not be changed as +#' [bs4_book()] has been designed to work with Bootstrap version 4 for now. +#' @md +bs4_book_theme <- function(primary = "#0068D9", version = 4, ...) { bslib::bs_theme(..., + version = 4, primary = primary, "font-size-base" = "1rem", ) diff --git a/man/bs4_book.Rd b/man/bs4_book.Rd index 0aea1b1da..6fd0cddf2 100644 --- a/man/bs4_book.Rd +++ b/man/bs4_book.Rd @@ -15,7 +15,7 @@ bs4_book( split_bib = FALSE ) -bs4_book_theme(primary = "#0068D9", ...) +bs4_book_theme(primary = "#0068D9", version = 4, ...) } \arguments{ \item{theme}{A named list or \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object. @@ -31,6 +31,9 @@ view source and edit buttons or a list with repository \code{base} link, default \code{\link[rmarkdown:html_document]{rmarkdown::html_document()}}.} \item{primary}{Primary colour: used for links and background of footer.} + +\item{version}{Passed to \code{\link[bslib:bs_theme]{bslib::bs_theme()}}. This should not be changed as +\code{\link[=bs4_book]{bs4_book()}} has been designed to work with Bootstrap version 4 for now.} } \description{ This output format is built with \href{https://getbootstrap.com}{bootstrap}, @@ -150,3 +153,4 @@ page as expected by social media: You can have a look at \href{https://github.com/rstudio/bookdown/blob/master/inst/templates/bs4_book.html}{\code{bs4_book()} HTML template} for details on how these variables are used. } +