From cef8c1120788e1806b84235f41709566b604f9d6 Mon Sep 17 00:00:00 2001 From: Andreas Gammelgaard Damsbo Date: Thu, 19 Dec 2024 11:32:32 +0100 Subject: [PATCH] experimenting with a default theme --- R/theme.R | 44 +++++++++++++++++++++++++------------------- man/custom_theme.Rd | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 man/custom_theme.Rd diff --git a/R/theme.R b/R/theme.R index ced2a21..ffc3c50 100644 --- a/R/theme.R +++ b/R/theme.R @@ -4,26 +4,32 @@ #' #' @returns theme list #' @export -custom_theme <- function(...){ +custom_theme <- function(..., + version = 5, + primary = "#1E4A8F", + secondary = "#FF6F61", + # success = "#1E4A8F", + # info = , + # warning = , + # danger = , + # fg = "#000", + # bg="#fff", + bootswatch = "united", + base_font = bslib::font_google("Montserrat"), + # base_font = bslib::font_google("Alice"), + # heading_font = bslib::font_google("Jost", wght = "800"), + # heading_font = bslib::font_google("Noto Serif"), + # heading_font = bslib::font_google("Alice"), + heading_font = bslib::font_google("Public Sans",wght = "700"), + code_font = bslib::font_google("Open Sans")){ bslib::bs_theme( ..., - # preset = "united", - version = 5, - primary = "#1E4A8F", - secondary = "#FF6F61", - # success = "#1E4A8F", - # info = , - # warning = , - # danger = , - # fg = "#000", - # bg="#fff", - bootswatch = "united", - base_font = bslib::font_google("Montserrat"), - # base_font = bslib::font_google("Alice"), - # heading_font = bslib::font_google("Jost", wght = "800"), - # heading_font = bslib::font_google("Noto Serif"), - # heading_font = bslib::font_google("Alice"), - heading_font = bslib::font_google("Public Sans",wght = "700"), - code_font = bslib::font_google("Open Sans") + version = version, + primary = primary, + secondary = secondary, + bootswatch = bootswatch, + base_font = base_font, + heading_font = heading_font, + code_font = code_font ) } diff --git a/man/custom_theme.Rd b/man/custom_theme.Rd new file mode 100644 index 0000000..963a51f --- /dev/null +++ b/man/custom_theme.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/theme.R +\name{custom_theme} +\alias{custom_theme} +\title{Custom theme based on unity} +\usage{ +custom_theme( + ..., + version = 5, + primary = "#1E4A8F", + secondary = "#FF6F61", + bootswatch = "united", + base_font = bslib::font_google("Montserrat"), + heading_font = bslib::font_google("Public Sans", wght = "700"), + code_font = bslib::font_google("Open Sans") +) +} +\arguments{ +\item{...}{everything passed on to bslib::bs_theme()} +} +\value{ +theme list +} +\description{ +Custom theme based on unity +}