From 61dd372f0f19ccd590e2ab7b4da596ddbdfe02b6 Mon Sep 17 00:00:00 2001 From: andrewjbe <56839927+andrewjbe@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:04:58 -0600 Subject: [PATCH] improved gt_base --- R/ojo_gt.R | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/R/ojo_gt.R b/R/ojo_gt.R index 5befc74..8a34648 100644 --- a/R/ojo_gt.R +++ b/R/ojo_gt.R @@ -50,6 +50,21 @@ gt_base <- function(data, transform = "uppercase", weight = "bold"), locations = gt::cells_column_labels(tidyselect::everything()) + ) |> + gt::tab_style( + style = list( + gt::cell_text(weight = "bold", + size = gt::px(font_size * 2)) + ), + locations = gt::cells_title(groups = "title") + ) |> + gt::tab_style( + style = list( + gt::cell_text(style = "italic", + color = "#333333", + size = gt::px(font_size * 1.25)) + ), + locations = gt::cells_title(groups = "subtitle") ) @@ -111,9 +126,7 @@ gt_okpi <- function(data, ) |> gt::tab_style( style = list( - gt::cell_text(weight = "bold", - color = ojothemes::okpi_red, - size = gt::px(font_size * 2)), + gt::cell_text(color = ojothemes::okpi_red), gt::css(padding.left = "10px", border.left = paste0("10px solid ", okpi_red, ";")) ), @@ -121,9 +134,6 @@ gt_okpi <- function(data, ) |> gt::tab_style( style = list( - gt::cell_text(style = "italic", - color = "#333333", - size = gt::px(font_size * 1.25)), gt::css(padding.left = "10px", border.left = paste0("10px solid ", okpi_red, ";")) ), @@ -170,10 +180,6 @@ gt_ojo <- function(data, ) |> gt::tab_style( style = list( - gt::cell_text(weight = "bold", - color = "#333333", - size = gt::px(font_size * 2)), - # I think this little splash of color is nice gt::css(padding.left = "10px", border.left = paste0("10px solid ", okpi_yellow, ";")) ), @@ -181,8 +187,6 @@ gt_ojo <- function(data, ) |> gt::tab_style( style = list( - gt::cell_text(style = "italic", - size = gt::px(font_size * 1.25)), gt::css(padding.left = "10px", border.left = paste0("10px solid ", okpi_yellow, ";")) ),