Skip to contents

Sofia Sans Condensed throughout on a warm cream ("light") or dark navy ("dark") ground, after SofaScore, with bold column labels and bold row-group labels. Column spanners are bold and underlined. Horizontal rules are hidden, so the ground alone separates the rows.

Usage

gt_theme_sofa(
  gt_object,
  style = "light",
  density = c("comfortable", "compact", "social"),
  ...
)

Arguments

gt_object

A gt table object to modify.

style

Character. The color scheme, "light" for a warm cream ground or "dark" for a dark navy ground. Defaults to "light".

density

Character. The type and padding scale. One of "comfortable", "compact", or "social". See Density. Defaults to "comfortable".

...

Additional arguments passed to gt::tab_options, applied last so they override anything the theme sets.

Value

Returns a modified gt table with the theme applied.

Details

The table background, its outer borders, and the last row's bottom border are all painted in the chosen ground color, so the rows read as separated by space rather than by rules. Row groups are closed with a black bottom border.

Density

density scales the theme's type and row padding together. "comfortable" leaves every size as the theme sets it, "compact" scales both down, and "social" scales both up, to the scale gt_save_crop() and gt_social_crop() export at.

Figures

Preview of the sofa theme, light stylePreview of the sofa theme, dark style

Examples

library(gt)
nfc_north <- subset(
  sdv_example_standings, division == "NFC North",
  c(team_name, wins:points_against)
)
gt(nfc_north) |> gt_theme_sofa()
team_name wins losses ties win_pct points_for points_against
Chicago Bears 11 6 0 0.647 441 415
Green Bay Packers 9 7 1 0.559 391 360
Minnesota Vikings 9 8 0 0.529 344 333
Detroit Lions 9 8 0 0.529 481 413
gt(nfc_north) |> gt_theme_sofa(style = "dark")
team_name wins losses ties win_pct points_for points_against
Chicago Bears 11 6 0 0.647 441 415
Green Bay Packers 9 7 1 0.559 391 360
Minnesota Vikings 9 8 0 0.529 344 333
Detroit Lions 9 8 0 0.529 481 413