It sounds like you're experiencing an issue where your Laravel 12 Livewire application is applying dark mode styles to your Login and Register pages, even after you've removed the dark: classes from your Blade templates. This could be due to a few reasons:
-
Tailwind CSS Configuration: If you're using Tailwind CSS, check your
tailwind.config.jsfile. There might be a configuration that automatically applies dark mode based on a certain condition, such as a media query or a class on thehtmlorbodytag.module.exports = { darkMode: 'class', // or 'media' or false // other configurations... }If
darkModeis set to'class', ensure that there isn't adarkclass being applied to a parent element likehtmlorbody. -
JavaScript: Check if there is any JavaScript code that is dynamically adding the
darkclass to your pages. This could be in your custom scripts or a third-party library.document.documentElement.classList.add('dark');Look for any code that might be adding the
darkclass to thedocument.documentElementorbody. -
Persistent State: If you're using a persistent state mechanism (like local storage) to remember the user's theme preference, ensure that it's not defaulting to dark mode.
const userPrefersDark = localStorage.getItem('theme') === 'dark'; if (userPrefersDark) { document.documentElement.classList.add('dark'); }Check if there's any logic that sets the theme based on a stored preference.
-
CSS Specificity: Ensure that there are no CSS rules with higher specificity that are overriding your changes. Use browser developer tools to inspect the elements and see which styles are being applied and from where.
-
Blade Components: If you're using Blade components, ensure that the
dark:classes aren't being applied within a component that is used by your Login and Register pages.
By checking these areas, you should be able to identify where the dark mode styles are being applied from and adjust accordingly. If you find that none of these solutions work, consider providing more context or code snippets for further assistance.