jthomasmock / gtExtras

A Collection of Helper Functions for the gt Package.
https://jthomasmock.github.io/gtExtras/
Other
195 stars 27 forks source link

Several themes don't properly style stubhead label #121

Closed jvroberts closed 7 months ago

jvroberts commented 7 months ago

Description

Several themes, including gt_theme_538() and gt_theme_nytimes(), don't properly style a custom tab_stubhead() label to match the rest of the column label styling.

Reproducible example

library(gt)
library(gtExtras)
exibble |> 
  gt(rowname_col = "row") |> 
  tab_stubhead(label = "stubhead") |> 
  gt_theme_538()

Expected result

"stubhead" label on first column should be styled to match the rest of the column header styles.

jvroberts commented 7 months ago

Specifically adding the cell styling to gt_theme_538.R on lines 76:78 seems to fix it:

      locations = list (
            gt::cells_column_labels(),
            gt::cells_stubhead()
      )