Files should contain only code related to their named purpose, with proper organization and formatting. When adding functionality: 1. Place code in files that match their purpose (e.g., theme-related code belongs in general utilities, not in specialized modules)
Files should contain only code related to their named purpose, with proper organization and formatting. When adding functionality:
Example of good organization:
// In custom.js (not in specialized files like loadShortbread.js)
function loadThemeFromLocalStorage(){
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
}
function runAfterDOMLoads() {
expandSubMenu();
makeCodeBlocksScrollable();
setupKeyboardFriendlyNavigation();
// Organized functions called in appropriate place
loadThemeFromLocalStorage();
loadShortbread();
}
Enter the URL of a public GitHub repository