js/light-mode-switch.js
/**
 * Summary: function that adds or removes the attribute 'data-theme' depending if
 * the switch is 'on' or 'off'.
 *
 * Description: initTheme is a function that uses localStorage from JavaScript DOM,
 * to store the value of the HTML switch. If the switch was already switched to
 * 'on' it will set an HTML attribute to the body named: 'data-theme' to a 'light'
 * value. If it is the first time opening the page, or if the switch was off the
 * 'data-theme' attribute will not be set.
 * @return {void}
 */


initTheme is a function that uses localStorage from JavaScript DOM,
to store the value of the HTML switch.
initTheme is a function that uses localStorage from JavaScript DOM to store the value of the HTML switch .
function initTheme() {
  var currentTheme = localStorage.getItem("currentTheme");
  if (currentTheme == null) {
    document.body.removeAttribute("data-theme")
  } else {
    document.body.setAttribute("data-theme", currentTheme)
    $("#theme-selector").val(currentTheme).change();
  }
}
function initTheme ( ) { var currentTheme = localStorage . getItem ( "currentTheme" ) ; if ( currentTheme == null ) { document . body . removeAttribute ( "data-theme" ) } else { document . body . setAttribute ( "data-theme" , currentTheme ) $ ( "#theme-selector" ) . val ( currentTheme ) . change ( ) ; } }
Summary: function that adds or removes the attribute 'data-theme' depending if
 the switch is 'on' or 'off'.
Summary : function that adds or removes the attribute ' data - theme ' depending if the switch is ' on ' or ' off ' .