gadenbuie / xaringanthemer

😎 Give your xaringan slides some style

Home Page:https://pkg.garrickadenbuie.com/xaringanthemer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Theme function writes CSS content twice

pat-s opened this issue · comments

When calling

duo_accent_inverse(
  primary_color = "white",
  secondary_color = "#272822",
  title_slide_background_color = "white",
  title_slide_text_color = "black",
  outfile = here::here("assets/css/xaringan.css"),
  header_font_google = google_font("Josefin Sans"),
  text_font_google = google_font("Montserrat", "500", "400i"),
  code_font_google = google_font("Droid Mono"),
  link_color = "#eb1455",
  text_bold_color = "#00589a",
  text_font_size = "25px",
  header_color = "#002733",
  padding = "1em 2em 1em 2em",
  background_color = "white",
  text_color = "black", 
  extra_fonts = list(google_font("Crimson Text"),
                     google_font("IBM Plex Mono")) 
)

with the current dev version, I get the whole CSS duplicated (in a new session, even when deleting the file beforehand). This causes problems with some fonts:

Some are only loaded in the second block and finally not honored in the HTML later on (e.g. IBM Plex Mono).

I've put the file into a gist so you can have a direct look at it.

This is a consequence of improper handling of the extra_fonts.

This should be entirely resolved in the dev branch, which I would love to push to master but have been sitting on for a bit. I renamed many of the functions for consistency so I've wanted to make sure documentation is all lined up before the merge, and your issues are definitely very motivating toward making that happen.

I'd greatly appreciate your testing if you don't mind trying out gadenbuie/xaringanthemer@dev. No breaking changes, but there should be deprecation warnings that give instructions about the name changes.

(I'm going to close this issue because it will be resolved with #19)

Thanks! 🚀