0
0
Tailwindmarkup~20 mins

Pairing light and dark colors in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Dark Mode Color Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use different colors for light and dark modes?
When designing a website with Tailwind CSS, why is it important to pair different colors for light and dark modes instead of using the same colors for both?
ABecause using the same colors for both modes will cause the website to load slower.
BBecause Tailwind CSS requires different colors for light and dark modes to compile correctly.
CBecause dark mode disables all colors except black and white.
DBecause colors that look good on a light background may not be visible or comfortable on a dark background.
Attempts:
2 left
💡 Hint
Think about how colors appear on different backgrounds and how that affects readability.
📝 Syntax
intermediate
2:00remaining
Tailwind syntax for dark mode background color
Which Tailwind CSS class correctly sets a background color of gray-100 in light mode and gray-900 in dark mode?
Abg-gray-100 dark:bg-gray-900
Bbg-gray-900 dark:bg-gray-100
Cbg-gray-100 bg-dark:bg-gray-900
Dbg-gray-100 dark-gray-900
Attempts:
2 left
💡 Hint
Remember the syntax for applying styles in dark mode uses the 'dark:' prefix.
rendering
advanced
2:00remaining
Visual result of paired text colors in light and dark modes
Given the following Tailwind classes on a paragraph: text-gray-800 dark:text-gray-200, what will the text color be when the user switches to dark mode?
Tailwind
<p class="text-gray-800 dark:text-gray-200">Hello, world!</p>
AThe text color stays dark gray (gray-800) even in dark mode.
BThe text color changes to a light gray (gray-200) on a dark background.
CThe text color becomes black in dark mode.
DThe text color becomes invisible in dark mode.
Attempts:
2 left
💡 Hint
Check how the 'dark:' prefix changes styles when dark mode is active.
selector
advanced
2:00remaining
Choosing the best Tailwind color pair for button backgrounds
Which Tailwind CSS class pair best ensures a button background is visually distinct and accessible in both light and dark modes?
Abg-blue-300 dark:bg-blue-500
Bbg-white dark:bg-black
Cbg-gray-100 dark:bg-gray-200
Dbg-blue-500 dark:bg-blue-300
Attempts:
2 left
💡 Hint
Think about which colors provide enough contrast on light and dark backgrounds.
accessibility
expert
2:00remaining
Ensuring text contrast meets accessibility standards in dark mode
You have a paragraph with class text-gray-400 dark:text-gray-600. What accessibility issue might this cause when switching to dark mode?
AText will become bold automatically in dark mode.
BText color will not change in dark mode, causing confusion.
CText contrast will be too low in dark mode, making it hard to read.
DText will be too bright in dark mode, causing eye strain.
Attempts:
2 left
💡 Hint
Consider how gray-600 looks on a dark background compared to gray-400 on a light background.