I found that the added logo may not display sometimes. For some unknown reasons, the quotes around the added css may corrupt sometimes. Actually, the quotes are not required. I have patched the logo_css function like so:
logo_css <- function(url, width, height, position) {
if (!is_css_position(position)) {
stop("Please use `css_position()` to specify the position of your logo", call. = FALSE)
}
dirs <- c("top", "right", "left", "bottom")
names(dirs) <- dirs
p <- lapply(dirs, function(pos) {
if (!is.null(position[[pos]])) sprintf("%s:%s;", pos, position[[pos]]) else ""
})
width <- htmltools::validateCssUnit(width)
height <- htmltools::validateCssUnit(height)
sprintf("
.xaringan-extra-logo {
width: %s;
height: %s;
z-index: 0;
background-image: url(%s);
background-size: contain;
background-repeat: no-repeat;
position: absolute;
%s%s%s%s
}
", width, height, url, p$top, p$right, p$bottom, p$left)
}
I found that the added logo may not display sometimes. For some unknown reasons, the quotes around the added css may corrupt sometimes. Actually, the quotes are not required. I have patched the
logo_css
function like so:If you agree with that, I can make a PR.