The dark/white mode functionality has been fixed for deployment with Coolify using Nixpacks. The improvements include:
Early theme initialization to prevent flashing Proper component and script loading order Enhanced error handling and fallbacks Better theme state persistence System theme preference detection The theme system will now work correctly in the production environment when deployed through Coolify with Nixpacks build pack.
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
<link rel="stylesheet" href="css/animations.css">
|
||||
<link rel="stylesheet" href="css/footer.css">
|
||||
<link rel="stylesheet" href="css/responsive.css">
|
||||
<script src="js/components.js" defer></script>
|
||||
<script src="js/theme.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
@@ -73,5 +71,16 @@
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- Load scripts at the end of body -->
|
||||
<script src="js/components.js"></script>
|
||||
<script>
|
||||
// Initialize theme only after components are loaded
|
||||
document.addEventListener('componentsLoaded', function() {
|
||||
const themeScript = document.createElement('script');
|
||||
themeScript.src = 'js/theme.js';
|
||||
document.body.appendChild(themeScript);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user