recon_gen.common.theme

QuickSight theme — registry default + builder.

Per N.1.g, the registry holds ONLY the default preset (a neutral blue/grey professional palette). Per-instance brand palettes (formerly sasquatch-bank, sasquatch-bank-investigation) moved to inline theme: blocks on the L2 YAML — apps consume the L2 theme via resolve_l2_theme(l2_instance).

The ThemePreset dataclass itself lives in common/l2/theme.py — theme is an L2 model concept; this module re-exports for back-compat and provides the build_theme(cfg) QuickSight Theme constructor.

Functions

build_theme(cfg, theme)

Build the QuickSight Theme resource for theme (N.4.k).

resolve_l2_theme(l2_instance)

Pick the theme to render with for an L2-fed app (N.1 / N.4.k).

class recon_gen.common.theme.ThemePreset(theme_name, version_description, analysis_name_prefix, data_colors, empty_fill_color, gradient, primary_bg, secondary_bg, primary_fg, secondary_fg, accent, accent_fg, link_tint, danger, danger_fg, warning, warning_fg, success, success_fg, dimension, dimension_fg, measure, measure_fg, logo=None, favicon=None)[source]

Bases: object

Everything that varies between theme variants.

Parameters:
  • theme_name (str)

  • version_description (str)

  • analysis_name_prefix (str | None)

  • data_colors (list[str])

  • empty_fill_color (str)

  • gradient (list[str])

  • primary_bg (str)

  • secondary_bg (str)

  • primary_fg (str)

  • secondary_fg (str)

  • accent (str)

  • accent_fg (str)

  • link_tint (str)

  • danger (str)

  • danger_fg (str)

  • warning (str)

  • warning_fg (str)

  • success (str)

  • success_fg (str)

  • dimension (str)

  • dimension_fg (str)

  • measure (str)

  • measure_fg (str)

  • logo (str | None)

  • favicon (str | None)

accent: str
accent_fg: str
analysis_name_prefix: str | None
danger: str
danger_fg: str
data_colors: list[str]
dimension: str
dimension_fg: str
empty_fill_color: str
favicon: str | None
gradient: list[str]
measure: str
measure_fg: str
primary_bg: str
primary_fg: str
secondary_bg: str
secondary_fg: str
success: str
success_fg: str
theme_name: str
version_description: str
warning: str
warning_fg: str
recon_gen.common.theme.build_theme(cfg, theme)[source]

Build the QuickSight Theme resource for theme (N.4.k).

Returns None when theme is None — the silent-fallback contract: an L2 instance with no inline theme: block deploys against AWS QuickSight’s CLASSIC theme without emitting a custom Theme resource. The CLI skips theme.json write + skips the deploy step in that case.

When theme is set, builds a complete Theme honoring permissions + tags from cfg.

Return type:

Theme | None

Parameters:
recon_gen.common.theme.resolve_l2_theme(l2_instance)[source]

Pick the theme to render with for an L2-fed app (N.1 / N.4.k).

Returns the L2 instance’s inline theme block when present (the N.1 path); None otherwise — the silent-fallback contract (N.4.k). Callers that consume the return for accent colors (e.g., Getting Started rich text) should fall through to DEFAULT_PRESET.accent so on-canvas colors stay sensible when no L2 theme is declared. The dashboard-level fallback is AWS QuickSight’s CLASSIC theme (no Theme resource emitted by build_theme when None).

Return type:

ThemePreset | None

Parameters:

l2_instance (L2Instance | None)