Skip to content

Add flowtheme_2026: a responsive theme with light/dark/system appearance - #184

Open
martinbogo wants to merge 1 commit into
gregstoll:mainfrom
martinbogo:theme/flowtheme-2026
Open

Add flowtheme_2026: a responsive theme with light/dark/system appearance#184
martinbogo wants to merge 1 commit into
gregstoll:mainfrom
martinbogo:theme/flowtheme-2026

Conversation

@martinbogo

Copy link
Copy Markdown
Contributor

What this is

A modern theme for Gallery 2.3, built entirely against the existing theme API — requiredCoreApi 7.20 / requiredThemeApi 2.4, the same as matrix. No core changes are required, and it lives alongside the bundled themes without touching them.

It has been running a real ~4,300-item gallery on PHP 8.2 / Debian 12 for the work that produced #180, #181 and #183.

Design notes

  • Three-state appearance. Follows the system by default; an explicit light/dark choice is remembered in localStorage. All colours are custom properties on :root, redefined once under @media (prefers-color-scheme: dark) and once under [data-theme="dark"], so the two appearances can't drift apart. color-scheme is declared so form controls and scrollbars follow too.
  • Justified photo grid. Row heights come from each photo's real aspect ratio ($child.width/height) rather than the square thumbnail crop, so portraits stop being letterboxed into squares.
  • Lightbox and infinite scroll are progressive enhancements. With JavaScript disabled, per-photo pages and the normal pager work unchanged — flow.js returns early if the grid isn't present, and every enhanced element degrades to a plain link.
  • Styles Gallery2's own markup rather than erasing it. gcBackground1/gcBorder1, gbAdminLink lists, gbDataTable, fieldsets and submit buttons all get theme-consistent styling, so Site Admin and module views render as part of the theme instead of unstyled. (An early revision neutralised gcBackground1 to transparent; with 385 uses across 192 module templates that flattened the entire admin UI, which is worth knowing if anyone attempts something similar.)
  • Ships MANIFEST and po/ scaffolding. Every user-visible string goes through i18n() / {g->text}.

Screenshot

images/screenshot.png is a synthetic placeholder, not a real capture — 505×170 to match the bundled themes, rendered programmatically from the theme's own palette tokens and showing the light and dark appearances side by side. The install it runs on is a private family gallery, so a genuine screenshot would have meant publishing personal photographs. Happy to replace it with a real capture from a demo gallery if you'd prefer, or drop the file entirely.

Testing

Exercised on a live 2.3.2 install: album grids, single-photo pages, video items, Site Admin (Plugins, Themes, Maintenance), the module views, error pages, and both appearances. Install/uninstall and switching to and from matrix both work through the normal Themes UI.

Caveats, stated plainly

  • po/ contains only strings.raw and the GNUmakefile; there are no translations yet.
  • The theme is new, so its API usage has been exercised against 2.3.2 but not against every module in the wild.
  • I'm not assuming you want another bundled theme — if this is better off as an out-of-tree contribution, just say so and I'll close this without any hard feelings.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pPeWCa9ToJFseWqbPrDH4

A modern theme for Gallery 2.3, built against the existing theme API
(core 7.20 / theme 2.4) with no core changes required.

- Three-state appearance: follows the system by default, with an explicit
  light/dark override remembered in localStorage. Colours are defined as
  custom properties on :root so both themes stay in sync, and
  color-scheme is declared so form controls follow too.
- Justified photo grid whose row heights come from each photo's real
  aspect ratio rather than the square thumbnail crop.
- Optional lightbox and infinite scroll, both progressive enhancements:
  with JavaScript off, per-photo pages and the normal pager still work.
- Styles Gallery2's own admin and module markup (gcBackground/gcBorder,
  gbAdminLink lists, gbDataTable) rather than overriding it away, so
  Site Admin renders consistently with the rest of the theme.

Ships MANIFEST and po/ scaffolding; all user-visible strings go through
i18n()/{g->text}.

images/screenshot.png is a synthetic placeholder rendered from the
theme's own palette, showing the light and dark appearances side by
side. It should be replaced with a real capture before release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015pPeWCa9ToJFseWqbPrDH4
@martinbogo

Copy link
Copy Markdown
Contributor Author

Apologies for not having a pretty thumbnail… I didn’t want to expose my own private photos, and I don’t have the example photo data to match the original thumbnail. “IOU” a nice thumbnail ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant