Skip to content

Dark mode: fix nav text, team name centering, event/RNG page whites, live chart colour updates#156

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/add-light-dark-mode-support
Draft

Dark mode: fix nav text, team name centering, event/RNG page whites, live chart colour updates#156
Copilot wants to merge 6 commits intomainfrom
copilot/add-light-dark-mode-support

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

Several pages had incomplete dark mode support, and chart colours only updated after a full page reload.

Nav bar & team page

  • Nav links were overridden to indigo (#818cf8) by the generic a {} dark-mode rule in style.scss — fixed by adding an explicit .nav-link override inside the dark-theme mixin
  • Team member name (h3) and role were text-align: left — changed to center to match the rest of the card

Event detail page (event.html)

Hard-coded white/light backgrounds in the inline <style> block. Added [data-theme="dark"] + @media (prefers-color-scheme: dark) overrides for:

  • .event-detail-card (the large white box)
  • .talk-card, .slides-container, .video-container
  • .meta-badge, .event-detail-title, h4 inline colours, .no-slides-message

Random number generator (random-number-generator.html + generate-random-numbers.js)

  • CSS overrides added for .form-label, .form-input, .result-card, .result-header
  • Root cause of the persistent white result box: generate-random-numbers.js was writing resultCard.style.background and resultHeader.style.color as inline styles (specificity 1,0,0), which defeated every CSS rule. Fixed by reading the active theme at call time and applying the correct value directly:
const isDark = attr === 'dark' ||
  (!attr && window.matchMedia?.('(prefers-color-scheme: dark)').matches);

resultCard.style.background = isDark ? '#1f2937' : 'linear-gradient(...)';
resultHeader.style.color    = isDark ? '#34d399' : '#065f46';

Live chart colour updates (default.html + statistics.md)

Charts read isDark once at DOMContentLoaded; toggling the mode had no effect without a reload.

  • applyTheme() in default.html now dispatches a themechange CustomEvent after applying the new theme
  • statistics.md extracts a getChartColors() helper, stores all three Chart.js instances in a chartInstances[] array, and listens for themechange to update tick/grid colours and call chart.update('none') on each — no reload needed
document.addEventListener('themechange', function() {
  const { tickColor, gridColor } = getChartColors();
  chartInstances.forEach(function(chart) {
    if (chart.options.scales?.y?.ticks) chart.options.scales.y.ticks.color = tickColor;
    if (chart.options.scales?.y?.grid)  chart.options.scales.y.grid.color  = gridColor;
    if (chart.options.scales?.x?.ticks) chart.options.scales.x.ticks.color = tickColor;
    chart.update('none');
  });
});

Note: the "Interactive charts unavailable" fallback visible in local preview is pre-existing and intentional — it triggers when the CDN (cdn.jsdelivr.net) is unreachable (e.g. in sandboxed environments). Charts load normally on the live GitHub Pages site.

Original prompt

This section details on the original issue you should resolve

<issue_title>Light/dark mode support</issue_title>
<issue_description>It looks like there is currently no Support for light and dark mode so please implement this make sure it's implemented on all the different sub pages and share screenshots once you've done the implementation Thank you</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
cloudnativelinz-github-io Ready Ready Preview, Comment Mar 3, 2026 0:57am

- FOUC-prevention script in <head> applies saved theme before first paint
- Theme toggle button in nav cycles: System → Light → Dark → System
- System mode follows OS/browser preference via prefers-color-scheme
- Choice persisted in localStorage under 'theme-preference'
- Comprehensive dark-mode CSS via SCSS mixin applied to [data-theme="dark"]
  attribute and @media (prefers-color-scheme: dark) media query
- All pages covered through the shared default layout

Co-authored-by: jetzlstorfer <7677092+jetzlstorfer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add light and dark mode support for all sub pages Add light/dark mode with nav toggle button Mar 3, 2026
…t colors

- Toggle button: remove system mode, use sun/moon icons only, default
  follows OS via prefers-color-scheme, migrates legacy 'system' value
- Team page: add dark mode CSS for .team-member white boxes and text
- Statistics charts: detect dark mode at init, use readable tick/grid
  colors (light gray) when in dark mode

Co-authored-by: jetzlstorfer <7677092+jetzlstorfer@users.noreply.github.com>
Copilot AI changed the title Add light/dark mode with nav toggle button Add light/dark mode with nav toggle, fix team/stats pages in dark mode Mar 3, 2026
Co-authored-by: jetzlstorfer <7677092+jetzlstorfer@users.noreply.github.com>
…ixes

Co-authored-by: jetzlstorfer <7677092+jetzlstorfer@users.noreply.github.com>
- generate-random-numbers.js: detect isDark at call time and apply
  theme-aware background/color as inline styles (root cause was JS inline
  style specificity (1,0,0) overriding all CSS rules)
- default.html: dispatch 'themechange' CustomEvent in applyTheme()
- statistics.md: getChartColors() helper + chartInstances[] + themechange
  listener → chart tick/grid colours update instantly on toggle
- event.html: dark mode overrides for .event-detail-card (big white box),
  .talk-card, .slides-container, .video-container, .meta-badge,
  .event-detail-title, h4 inline colours, .no-slides-message

Co-authored-by: jetzlstorfer <7677092+jetzlstorfer@users.noreply.github.com>
Copilot AI changed the title Add light/dark mode with nav toggle, fix team/stats pages in dark mode Dark mode: fix white boxes, live chart updates, result card, event page Mar 3, 2026
Copilot AI changed the title Dark mode: fix white boxes, live chart updates, result card, event page Dark mode: fix nav text, team name centering, event/RNG page whites, live chart colour updates Mar 3, 2026
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.

Light/dark mode support

2 participants