fix: use daisyUI theme colors on admin, settings and import/export pages #68

Merged
jfro merged 3 commits from jtk/dark-theme-colors into main 2026-10-18 23:00:08 +00:00
Owner

Replaces the hardcoded light-theme colors in the admin, settings, import/export and book pages with daisyUI theme classes, so they follow the dark theme instead of showing light cards.

Mapping

  • bg-white → bg-base-100; bg-gray-50/100 → bg-base-200; bg-gray-200 → bg-base-300 (toggle tracks, progress bar track)
  • text-gray-700/800/900 → text-base-content; text-gray-600 → text-base-content/70; text-gray-500 → text-base-content/60
  • border-gray-200/300 → border-base-300; divide-gray-200 → divide-base-300
  • indigo-* → primary (bg-primary, text-primary, bg-primary/10 for active tabs, focus:ring-primary; the Admin → Users primary button uses text-primary-content)
  • bg-gray-600 (secondary button, unknown-status bar) → bg-neutral

Left alone on purpose: the white toggle knobs (fine on both themes), the black barcode-scanner overlay, and the pastel status badges (green/red/yellow-100 with -800 text), which stay readable in dark mode.

Test: theme_classes_test.exs scans lib/fuzzy_catalog_web/**/*.{ex,heex} for bg-white and gray/slate/indigo color classes, so new ones get flagged (115 hits before this change, 0 after).

Merge note: admin_users_live.html.heex is also changed by #66 (OIDC-only toggle), so whichever merges second needs a rebase; the new toggle block in #66 will need the same class swap.

Fixes #16

Replaces the hardcoded light-theme colors in the admin, settings, import/export and book pages with daisyUI theme classes, so they follow the dark theme instead of showing light cards. **Mapping** - `bg-white` → `bg-base-100`; `bg-gray-50/100` → `bg-base-200`; `bg-gray-200` → `bg-base-300` (toggle tracks, progress bar track) - `text-gray-700/800/900` → `text-base-content`; `text-gray-600` → `text-base-content/70`; `text-gray-500` → `text-base-content/60` - `border-gray-200/300` → `border-base-300`; `divide-gray-200` → `divide-base-300` - `indigo-*` → `primary` (`bg-primary`, `text-primary`, `bg-primary/10` for active tabs, `focus:ring-primary`; the Admin → Users primary button uses `text-primary-content`) - `bg-gray-600` (secondary button, unknown-status bar) → `bg-neutral` Left alone on purpose: the white toggle knobs (fine on both themes), the black barcode-scanner overlay, and the pastel status badges (green/red/yellow-100 with -800 text), which stay readable in dark mode. **Test:** `theme_classes_test.exs` scans `lib/fuzzy_catalog_web/**/*.{ex,heex}` for `bg-white` and `gray/slate/indigo` color classes, so new ones get flagged (115 hits before this change, 0 after). **Merge note:** `admin_users_live.html.heex` is also changed by #66 (OIDC-only toggle), so whichever merges second needs a rebase; the new toggle block in #66 will need the same class swap. Fixes #16
jfro added this to the 0.6.2 milestone 2026-10-18 22:25:47 +00:00
fix: use daisyUI theme colors on admin, settings and import/export pages
All checks were successful
CI / test (pull_request) Successful in 1m46s
4297fda9d5
Author
Owner

Review from Nye (changes requested) — PR #68 at 4297fda (fixes #16)

Checked: full diff (12 files), the mapping against the app's light/dark daisyUI themes in assets/css/app.css, rendered the changed admin/settings markup in headless Chromium with daisyUI 5 + both themes, checked the new test's regex in Elixir 1.18, and checked #68 merges cleanly with every open 0.6.2 PR (#53–#59, #63–#67) with 0 offenders left in each merged tree (incl. #66 + e59d268).

Blocker

  1. admin_users_live.html.heex:156: <.button class="bg-primary hover:bg-primary/90">Create User</.button>. <.button> with no variant renders btn btn-primary btn-soft; btn-soft sets the text to the primary color, so the label is primary-on-primary and invisible in both themes (verified by render). Fix: <.button variant="primary" phx-disable-with="Creating..." disabled={@creating_user}> and drop the bg classes.

Should fix (same cause, low)
2. user_settings_html/edit.html.heex:42: "Send Confirmation Email" <.button class="bg-neutral hover:bg-neutral/80 ..."> gets btn-soft's primary text on neutral (orange on grey in light, indigo on slate in dark), poor contrast. Add text-neutral-content (verified it renders white on neutral in both themes).

Nits (non-blocking)

  • book_html/show.html.heex:14 Delete book: text-white → text-error-content (untouched line, fine to leave).
  • theme_classes_test: add an assert that the wildcard found files, so a moved directory can't make it pass vacuously. Regex verified: catches hover:/focus: prefixes and bg-white/50, ignores bg-whitesmoke.
  • Pastel blue boxes (admin users 'Account Confirmation Required', blue-100 badges, text-blue-600 icons) are left like the other pastel badges; consistent with the PR's stated choice.

Good: mapping is consistent; active tabs, toggles, borders and tables read well in both themes; no behavior changes. CI green on 4297fda. Merges clean with #66 (git merge-tree shows no conflict, despite the PR's merge note), and e59d268 on #66 looks right.

Review from Nye (changes requested) — PR #68 at 4297fda (fixes #16) Checked: full diff (12 files), the mapping against the app's light/dark daisyUI themes in assets/css/app.css, rendered the changed admin/settings markup in headless Chromium with daisyUI 5 + both themes, checked the new test's regex in Elixir 1.18, and checked #68 merges cleanly with every open 0.6.2 PR (#53–#59, #63–#67) with 0 offenders left in each merged tree (incl. #66 + e59d268). Blocker 1. admin_users_live.html.heex:156: `<.button class="bg-primary hover:bg-primary/90">Create User</.button>`. `<.button>` with no variant renders `btn btn-primary btn-soft`; btn-soft sets the text to the primary color, so the label is primary-on-primary and invisible in both themes (verified by render). Fix: `<.button variant="primary" phx-disable-with="Creating..." disabled={@creating_user}>` and drop the bg classes. Should fix (same cause, low) 2. user_settings_html/edit.html.heex:42: "Send Confirmation Email" `<.button class="bg-neutral hover:bg-neutral/80 ...">` gets btn-soft's primary text on neutral (orange on grey in light, indigo on slate in dark), poor contrast. Add `text-neutral-content` (verified it renders white on neutral in both themes). Nits (non-blocking) - book_html/show.html.heex:14 Delete book: `text-white` → `text-error-content` (untouched line, fine to leave). - theme_classes_test: add an assert that the wildcard found files, so a moved directory can't make it pass vacuously. Regex verified: catches hover:/focus: prefixes and bg-white/50, ignores bg-whitesmoke. - Pastel blue boxes (admin users 'Account Confirmation Required', blue-100 badges, text-blue-600 icons) are left like the other pastel badges; consistent with the PR's stated choice. Good: mapping is consistent; active tabs, toggles, borders and tables read well in both themes; no behavior changes. CI green on 4297fda. Merges clean with #66 (git merge-tree shows no conflict, despite the PR's merge note), and e59d268 on #66 looks right.
fix: readable Create User and Send Confirmation Email buttons
All checks were successful
CI / test (pull_request) Successful in 47s
06f2662b18
Create User uses variant="primary" (btn-soft made its label primary on
primary), Send Confirmation Email gets text-neutral-content, Delete book
uses text-error-content, and the theme test asserts it found templates.
Merge remote-tracking branch 'origin/main' into jtk/dark-theme-colors
All checks were successful
CI / test (pull_request) Successful in 46s
d551e5e453
# Conflicts:
#	test/fuzzy_catalog_web/live/admin_users_live_test.exs
Author
Owner

Review from Nye (approved) at d551e5e

Covers 06f2662 (Create User is variant="primary" with no bg override, Send Confirmation Email has text-neutral-content, Delete book text-error-content, theme test guards against an empty glob, new LiveView test pins btn-primary without btn-soft) and the main merge d551e5e. Only the admin_users_live_test conflict differs from auto-merge, resolved keeping both the Create User test and main's tests. CI green.

Review from Nye (approved) at d551e5e Covers 06f2662 (Create User is `variant="primary"` with no bg override, Send Confirmation Email has text-neutral-content, Delete book text-error-content, theme test guards against an empty glob, new LiveView test pins btn-primary without btn-soft) and the main merge d551e5e. Only the admin_users_live_test conflict differs from auto-merge, resolved keeping both the Create User test and main's tests. CI green.
jfro merged commit 17be9ebf0e into main 2026-10-18 23:00:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/fuzzy_catalog!68
No description provided.