Files
sure/app/javascript
Guillem Arias Fauste 272b8acd66 feat(theme): broadcast theme:change so SVG/canvas consumers can repaint (#1839)
`theme_controller#setTheme` already toggles `data-theme` on the
document element, but D3/SVG/canvas consumers that bake color into
attributes (`fill`, `stroke`, `stop-color`) can't observe a CSS
variable change — they need an imperative re-render hook.

Dispatch a `theme:change` CustomEvent on the document element after
the attribute flips, with `detail: { theme: "dark" | "light" }`.
Consumers subscribe via standard connect/disconnect listeners.

Refactor the if/else into a single path while at it — same behavior,
half the lines.

Closes #1764.
2026-05-20 18:13:07 +02:00
..
2025-05-20 13:31:05 -05:00