Skip to content

feat(frontend): add light/dark theming with theme picker#300

Open
marcalexiei wants to merge 4 commits into
stats-organization:masterfrom
marcalexiei:dark-theme
Open

feat(frontend): add light/dark theming with theme picker#300
marcalexiei wants to merge 4 commits into
stats-organization:masterfrom
marcalexiei:dark-theme

Conversation

@marcalexiei

@marcalexiei marcalexiei commented Jun 24, 2026

Copy link
Copy Markdown

Adds light/dark theming to the frontend using the existing DaisyUI + Tailwind setup.

  • Theme picker dropdown in the header; selection is stored in Redux and persisted to localStorage.
    The toggle and each option show a sun/moon icon (shared ThemeIcon component) so light/dark are easy to tell apart.
  • Migrated hardcoded colors to DaisyUI tokens so the whole UI (and toasts) follow the theme.
  • Button now uses variant / size / outline props instead of raw btn-* classes.
  • Theme preview cards: (Select Theme grid and the final Display card) sit on a two-tone backdrop (light or dark), chosen by the card theme so previews stay consistent regardless of the app theme.
  • Smooth theme-switch transitions: surfaces fade gently while interactive elements stay snappy; respects prefers-reduced-motion.
  • Added an e2e test for the picker.
Step 1

Screenshot 2026-06-24 at 06 54 40 Screenshot 2026-06-24 at 06 54 32

Step 4

Screenshot 2026-06-24 at 06 56 22 Screenshot 2026-06-24 at 06 55 41

@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@martin-mfg martin-mfg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I expected this to be among the first feature requests from new users, to add a dark mode. ;) Good to be ahead of this.

  1. Could you please use the "github_dark" theme for cards in the login step in dark mode?

  2. A selected text input had a colored border before:
    Image
    Now it has a black extra border with uneven padding instead:
    Image
    Is this intentional? If not, let's revert to the old approach.

  3. For the "transparent" and "ambient_gradient" card themes, can we use a light backdrop in light mode and a dark backdrop in dark mode? I think both card themes are well suited for both modes.

  4. For "highcontrast" and "chartreuse-dark", a light backdrop is created although these themes have dark backgrounds.

  5. The hover effect of the "GitHub Public Access" button is barely visible. Can we make this stronger?

  6. The "GitHub Private Access" and "Continue as Guest" button now use grey text, which makes them slightly harder to read. Is this intended? Otherwise I'd revert to black text there.

  7. Do you think it would make sense to sort the card themes in step 4 to list all light themes first and all dark themes afterwards?

Comment thread apps/frontend/src/index.css Outdated
Comment thread apps/frontend/src/components/Card/themeBackdrop.ts Outdated
Comment thread apps/frontend/index.html
Comment on lines +40 to +55
<script>
// Apply the persisted (or system) theme before first paint to avoid a flash.
// Also suppress color transitions until after the first paint so elements
// don't animate from their unstyled state on load.
(function () {
try {
var stored = localStorage.getItem("theme");
const matchesDarkTheme = window.matchMedia(
"(prefers-color-scheme: dark)",
).matches;
var theme = stored || (matchesDarkTheme ? "dark" : "light");
document.documentElement.setAttribute("data-theme", theme);
document.documentElement.classList.add("no-transitions");
} catch (e) {}
})();
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this code have any visible effect? I tried with and without it and couldn't spot a difference.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but only when the saved theme differs from the OS preference DaisyUI's --prefersdark covers the OS default, and nothing in React sets data-theme on mount, so the script is what applies a saved theme on reload (e.g., OS light + saved Dark). The "persists across reload" e2e test relies on it.

@marcalexiei marcalexiei left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Could you please use the "github_dark" theme for cards in the login step in dark mode?

Done.


  1. A selected text input had a colored border before. Now it has a black extra border with uneven padding instead. Is this intentional? If not, let's revert to the old approach.

Not intentional (it came from the DaisyUI input class). Reverted to the old bordered style, now theme-aware.


  1. For the "transparent" and "ambient_gradient" card themes, can we use a light backdrop in light mode and a dark backdrop in dark mode? I think both card themes are well suited for both modes.

Done — these now follow the app mode (light backdrop in light mode, dark in dark mode).


  1. For "highcontrast" and "chartreuse-dark", a light backdrop is created although these themes have dark backgrounds.

Their bg_color is the 3-digit "000", which the luminance check rejected. Short hex is now expanded, so both read as dark.


  1. The hover effect of the "GitHub Public Access" button is barely visible. Can we make this stronger?

Done — the primary hover now darkens more (18% vs DaisyUI's default ~7%).


  1. The "GitHub Private Access" and "Continue as Guest" button now use grey text, which makes them slightly harder to read. Is this intended? Otherwise I'd revert to black text there.

Not intended. They're now solid neutral buttons with a proper background and high-contrast text.


  1. Do you think it would make sense to sort the card themes in step 4 to list all light themes first and all dark themes afterwards?

Ok. Now order is light, adaptive and dark.
Maybe in the future we can add a more distinctive division between them.

@marcalexiei marcalexiei requested a review from martin-mfg June 25, 2026 11:40
…olors

- make title of "gradient" theme visible also in dark and light mode
- cards use dark theme in dark mode in step 2 and 3
- cards use corresponding backdrop in all steps
- restore hover effect for cards with backdrops
- restore cursor pointer for card buttons
- custom focus style for <select> and <input>
- change several colors
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
github-stats-extended-backend Ready Ready Preview, Comment Jun 28, 2026 6:46pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
github-stats-extended-frontend Ignored Ignored Jun 28, 2026 6:46pm

change "delete account" related colors

@martin-mfg martin-mfg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added several changes to this PR:

  • make title of "gradient" theme visible in dark and light mode
  • cards use dark theme in dark mode in step 2 and 3
  • cards use corresponding backdrop also in step 2
  • restore hover effect for cards with backdrops
  • restore cursor pointer for card buttons
  • custom focus style for and
  • change several colors

From my perspective it can be merged now. But first I would like to ask for a review from you for my changes.

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.

2 participants