fix(logo): take style_flextable_civilytics() defaults from civilytics_colors (#21)

Header, zebra, borders, and footer text now use navy_700, paper_2,
rule_strong, rule, and ink_3 instead of Bootstrap hex values. Tables built
with the defaults change appearance.

Closes #21

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Sonnet 5.5 committed 2026-10-15 15:27:54 -04:00
1 parent 4f697e2d52
commit d6e3ba2fb4
3 files changed
+42 -20

No files matched your search

+12 -10
View File
@@ -15,7 +15,8 @@
#' `flextable` is unavailable.
#'
#' @param ft A [flextable::flextable()] object.
#' @param header_bg Character. Header background fill. Default `"#2c3e50"`.
#' @param header_bg Character. Header background fill. Default
#' `civilytics_colors[["navy_700"]]`.
#' @param header_color Character. Header text color. Default `"white"`.
#' @param title_fontsize Numeric. Font size for the first header line (the
#' title row, `i = 1`). Default `14`.
@@ -25,17 +26,18 @@
#' @param zebra Logical. Apply alternating-row striping to even body rows.
#' Default `TRUE`. Safely skipped for tables with fewer than two body rows.
#' @param zebra_bg Character. Fill color for striped (even) body rows.
#' Default `"#f0f0eb"`.
#' Default `civilytics_colors[["paper_2"]]`.
#' @param outer_border_color Character. Outer border color. Default
#' `"#888888"`.
#' `civilytics_colors[["rule_strong"]]`.
#' @param outer_border_width Numeric. Outer border width. Default `1`.
#' @param inner_border_color Character. Inner horizontal border color (body).
#' Default `"#cccccc"`.
#' Default `civilytics_colors[["rule"]]`.
#' @param inner_border_width Numeric. Inner horizontal border width. Default
#' `0.5`.
#' @param footer_fontsize Numeric. Footer font size (applied only if a footer
#' part exists). Default `9`.
#' @param footer_color Character. Footer text color. Default `"#555555"`.
#' @param footer_color Character. Footer text color. Default
#' `civilytics_colors[["ink_3"]]`.
#'
#' @return The styled [flextable::flextable()] object.
#' @export
@@ -50,19 +52,19 @@
#' style_flextable_civilytics()
#' }
style_flextable_civilytics <- function(ft,
header_bg = "#2c3e50",
header_bg = civilytics_colors[["navy_700"]],
header_color = "white",
title_fontsize = 14,
body_fontsize = 11,
font_name = "Arial",
zebra = TRUE,
zebra_bg = "#f0f0eb",
outer_border_color = "#888888",
zebra_bg = civilytics_colors[["paper_2"]],
outer_border_color = civilytics_colors[["rule_strong"]],
outer_border_width = 1,
inner_border_color = "#cccccc",
inner_border_color = civilytics_colors[["rule"]],
inner_border_width = 0.5,
footer_fontsize = 9,
footer_color = "#555555") {
footer_color = civilytics_colors[["ink_3"]]) {
if (!requireNamespace("flextable", quietly = TRUE)) {
stop("Install 'flextable' to use this function.", call. = FALSE)
}