This website now features a Material You design system with dynamic dark/light theme switching.
The theme system uses CSS custom properties (variables) that are dynamically updated based on the selected theme:
Light Theme Colors:
#0085a1#7cb342#ff6f00#fffbfe#ffffffDark Theme Colors:
#80deea#c5e1a5#ffb74d#0f0f12#1a1a1a/js/theme-toggle.js: Main theme switching logic with localStorage persistence/less/theme.less: Theme color definitions (light and dark variants)/less/material-design.less: Material Design system tokens (elevation, shapes, transitions)/less/variables.less: LESS variables and Material You color tokensClick the sun/moon icon in the navigation bar to toggle between themes. Your preference is automatically saved.
1
2
3
4
5
6
7
8
9
10
// Get current theme
const theme = window.themeManager.getCurrentTheme(); // 'light' or 'dark'
// Toggle theme
window.toggleTheme();
// Listen to theme changes
window.addEventListener('themechange', (e) => {
console.log('Theme changed to:', e.detail.theme);
});
Use Material You CSS variables directly in your CSS/LESS:
.my-element {
background-color: var(--surface);
color: var(--on-surface);
border: 1px solid var(--border-color);
}
// Material Design elevation system
.card {
.elevation-2;
}
// Material Design shapes
.button {
.shape-medium;
}
// State layers for interactions
.interactive {
&:hover {
background-color: var(--hover-overlay);
}
}
Colors:
--primary, --primary-container, --on-primary, --on-primary-container--secondary, --secondary-container, --on-secondary, --on-secondary-container--tertiary, --tertiary-container, --on-tertiary, --on-tertiary-container--error, --error-container, --on-error, --on-error-container--surface, --surface-dim, --surface-bright, --surface-container*--on-surface, --on-surface-variant--background, --on-background--outline, --outline-variant--border-color, --shadow-color, --hover-overlayMaterial Design Classes:
.elevation-0 through .elevation-5.shape-extra-small, .shape-small, .shape-medium, .shape-large, .shape-extra-large.transition-standard, .transition-emphasis, .transition-decelerate, .transition-accelerate.state-hover, .state-focus, .state-activeThe website defaults to dark theme on first visit. Users can switch to light theme using the theme toggle button.
To customize theme colors, edit:
.theme-light in /less/theme.less.theme-dark in /less/theme.less/less/variables.lessThen rebuild CSS with:
1
npm run start # or grunt
The theme system works seamlessly with GitHub Pages:
Build and deploy:
1
2
3
4
npm run start # Start dev server
npm run dev # Watch mode
grunt # Build assets
git push # Deploy to GitHub Pages