If you have installed Laravel Breeze with the --dark flag, you should see a dark class added to the body tag in your application's layout file. This class is used to toggle between light and dark mode styles.
To enable dark mode, you need to add some CSS styles to your application. You can do this by adding a dark class to your CSS selectors and defining styles for that class. For example:
/* Light mode styles */
body {
background-color: #fff;
color: #333;
}
/* Dark mode styles */
.dark body {
background-color: #333;
color: #fff;
}
In this example, the body tag has a white background and black text in light mode. In dark mode, the dark class is added to the body tag, which changes the background color to black and the text color to white.
You can also use CSS variables to define your light and dark mode styles. For example:
:root {
--bg-color: #fff;
--text-color: #333;
}
.dark {
--bg-color: #333;
--text-color: #fff;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
}
In this example, the :root selector defines two CSS variables for the background color and text color. The dark class changes the values of these variables for dark mode. The body tag uses these variables to set the background color and text color.
Make sure to clear your browser cache and refresh the page after making changes to your CSS file.