Complete the code to apply a dark background color using Tailwind CSS.
<div class="bg-white [1]:bg-gray-800 p-4"> <p class="text-black dark:text-white">Hello, world!</p> </div>
The dark variant applies styles when the user prefers dark mode. Here, dark:bg-gray-800 sets a dark background in dark mode.
Complete the code to change text color in dark mode using Tailwind CSS.
<p class="text-gray-900 [1]:text-gray-100">This text changes color in dark mode.</p>
The dark variant changes the text color when dark mode is active.
Fix the error in the code to correctly apply dark mode background color.
<div class="bg-white [1]:bg-gray-900 p-6"> Dark mode background example. </div>
The correct variant prefix for dark mode is dark. It should be dark:bg-gray-900.
Fill both blanks to apply dark mode text and background colors.
<section class="[1]:bg-gray-900 [2]:text-gray-100 p-8"> Dark mode styled section. </section>
Both background and text color changes use the dark variant to apply styles in dark mode.
Fill all three blanks to create a button with dark mode background, text, and border colors.
<button class="bg-white [1]:bg-gray-800 text-black [2]:text-white border border-gray-300 [3]:border-gray-600 px-4 py-2 rounded"> Dark Mode Button </button>
All three styles use the dark variant to change background, text, and border colors in dark mode.