function enableLightTheme() {
    // Updating the theme preference in localStorage to light.
    localStorage.theme = "light";

    /**********************************************************
        This is where the restyling for light theme begins.
     **********************************************************/

    // Setting the body's background to white.
    document.body.style.backgroundColor = "white";

    // Setting both of the corresponding theme buttons to white.
    themeToggleButtons.forEach((button) => {
        button.style.color = "white";
    });

    // Setting the textinfo-headings and their corresponding text to black (for contrast to white body) by removing the dark-mode classes.
    document
        .querySelectorAll("div[class='textinfo-heading dark-mode-heading']")
        .forEach((heading) => {
            Array.from(heading.parentNode.children).forEach((child) => {
                child.classList == "textinfo-heading dark-mode-heading"
                    ? (child.classList = "textinfo-heading")
                    : child.removeAttribute("class");
            });
        });

    // Setting the main section paragraphs (quotes and text bodies) to black (for contrast to white body) by removing the dark-mode-text class.
    document.querySelectorAll("p:not(#chef-name)").forEach((text) => {
        text.classList == "dark-mode-text"
            ? text.removeAttribute("class")
            : (text.classList = text.classList.value.replace(
                  " dark-mode-text",
                  ""
              ));
    });

    // If the form is on this page...
    if (inquiryForm != null) {
        // Set its text to black (for contrast to white body) by removing the dark-mode-text class.
        // Form header.
        inquiryForm.querySelector("h3").removeAttribute("class");
        // Form input labels.
        inquiryForm.querySelectorAll("label").forEach((label) => {
            label.removeAttribute("class");
        });
    }

    // If the flickity dots are being used on this page...
    if (document.querySelector("ol.flickity-page-dots") != null) {
        // Remove the dark flickity dot style.
        document.querySelector("head").removeChild(darkDotStyle);
    }

    // Setting the toast message to light mode version.
    document.querySelector("span.toast-msg-dark").classList = "toast-msg";
}
// This function enables light theme for all pages on the site.
This function enables light theme for all pages on the site.
This function enables light theme for all pages on the site .
function enableLightTheme() {
    localStorage.theme = "light";
    document.body.style.backgroundColor = "white";
    themeToggleButtons.forEach((button) => {
        button.style.color = "white";
    });
    document
        .querySelectorAll("div[class='textinfo-heading dark-mode-heading']")
        .forEach((heading) => {
            Array.from(heading.parentNode.children).forEach((child) => {
                child.classList == "textinfo-heading dark-mode-heading"
                    ? (child.classList = "textinfo-heading")
                    : child.removeAttribute("class");
            });
        });
    document.querySelectorAll("p:not(#chef-name)").forEach((text) => {
        text.classList == "dark-mode-text"
            ? text.removeAttribute("class")
            : (text.classList = text.classList.value.replace(
                  " dark-mode-text",
                  ""
              ));
    });
    if (inquiryForm != null) {
        inquiryForm.querySelector("h3").removeAttribute("class");
        inquiryForm.querySelectorAll("label").forEach((label) => {
            label.removeAttribute("class");
        });
    }
    if (document.querySelector("ol.flickity-page-dots") != null) {
        document.querySelector("head").removeChild(darkDotStyle);
    }
    document.querySelector("span.toast-msg-dark").classList = "toast-msg";
}
function enableLightTheme ( ) { localStorage . theme = "light" ; document . body . style . backgroundColor = "white" ; themeToggleButtons . forEach ( ( button ) => { button . style . color = "white" ; } ) ; document . querySelectorAll ( "div[class='textinfo-heading dark-mode-heading']" ) . forEach ( ( heading ) => { Array . from ( heading . parentNode . children ) . forEach ( ( child ) => { child . classList == "textinfo-heading dark-mode-heading" ? ( child . classList = "textinfo-heading" ) : child . removeAttribute ( "class" ) ; } ) ; } ) ; document . querySelectorAll ( "p:not(#chef-name)" ) . forEach ( ( text ) => { text . classList == "dark-mode-text" ? text . removeAttribute ( "class" ) : ( text . classList = text . classList . value . replace ( " dark-mode-text" , "" ) ) ; } ) ; if ( inquiryForm != null ) { inquiryForm . querySelector ( "h3" ) . removeAttribute ( "class" ) ; inquiryForm . querySelectorAll ( "label" ) . forEach ( ( label ) => { label . removeAttribute ( "class" ) ; } ) ; } if ( document . querySelector ( "ol.flickity-page-dots" ) != null ) { document . querySelector ( "head" ) . removeChild ( darkDotStyle ) ; } document . querySelector ( "span.toast-msg-dark" ) . classList = "toast-msg" ; }
This function enables light theme for all pages on the site.
This function enables light theme for all pages on the site .
// Updating the theme preference in localStorage to light. /**********************************************************
        This is where the restyling for light theme begins.
     **********************************************************/ // Setting the body's background to white. // Setting both of the corresponding theme buttons to white. // Setting the textinfo-headings and their corresponding text to black (for contrast to white body) by removing the dark-mode classes. // Setting the main section paragraphs (quotes and text bodies) to black (for contrast to white body) by removing the dark-mode-text class. // If the form is on this page... // Set its text to black (for contrast to white body) by removing the dark-mode-text class. // Form header. // Form input labels. // If the flickity dots are being used on this page... // Remove the dark flickity dot style. // Setting the toast message to light mode version.