Default to light mode

Is there a way to get a site to always default to light mode? I’m new to HTML and Hugo in general but this seems like its a pretty simple thing to fix.

// Get theme variation (day/night).
let defaultThemeVariation;
if ($('body').hasClass('dark')) {
  // The `color_theme` of the site is dark.
  defaultThemeVariation = 1;
} else if ($('.js-dark-toggle').length && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  // The visitor prefers dark themes and switching to the dark variation is allowed by admin.
  defaultThemeVariation = 1;
} else {
  // Default to day (light) theme.
  defaultThemeVariation = 0;
}
let dark_mode = parseInt(localStorage.getItem('dark_mode') || defaultThemeVariation);

Thanks!

Hi there,

That sounds like a general HTML/CSS/JS question. We do not provide support for these types of questions in this forum, only Hugo-specific questions. Please have a read about Requesting Help for more information.