From 1a6f0d150c174656601e2e5c969bc09aedf574ca Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Tue, 3 Sep 2024 21:30:44 -0700 Subject: [PATCH] Use reprex's own CSS and html template --- R/reprex_render.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/reprex_render.R b/R/reprex_render.R index b0e2145c..fd69d9d5 100644 --- a/R/reprex_render.R +++ b/R/reprex_render.R @@ -184,17 +184,18 @@ reprex_render_impl <- function(input, # heavily influenced by the post_processor() function of github_document() preview <- function(input) { + mode <- if (is_dark_mode()) "dark" else "light" css <- rmarkdown::pandoc_path_arg( path_package( - "rmarkdown", - "rmarkdown/templates/github_document/resources/github.css" + "reprex", + glue("rmarkdown/templates/reprex_document/resources/github-{mode}.css") ) ) css <- glue("github-markdown-css:{css}") template <- rmarkdown::pandoc_path_arg( path_package( - "rmarkdown", - "rmarkdown/templates/github_document/resources/preview.html" + "reprex", + "rmarkdown/templates/reprex_document/resources/preview.html" ) ) args <- c(