Challenge - 5 Problems
Color System Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why use a color system in web design?
Which of the following best explains why a color system is important in web development?
Attempts:
2 left
💡 Hint
Think about how consistent colors affect the look and feel of a website.
✗ Incorrect
A color system helps keep colors consistent across all pages. This makes the site look professional and easier to update.
📝 Syntax
intermediate2:00remaining
Tailwind color usage with custom variables
Given this Tailwind CSS snippet, what color will the text be if the custom property --brand-color is set to #4a90e2?
Tailwind
text-[var(--brand-color)]
Attempts:
2 left
💡 Hint
Tailwind allows using CSS variables inside square brackets for custom values.
✗ Incorrect
Using text-[var(--brand-color)] applies the CSS variable value as the text color. If --brand-color is #4a90e2, the text will be that blue color.
❓ selector
advanced2:00remaining
Selecting elements with Tailwind color classes
Which CSS selector matches all elements with a Tailwind class that sets the background color to blue-500?
Attempts:
2 left
💡 Hint
Tailwind uses exact class names for colors like bg-blue-500.
✗ Incorrect
The class bg-blue-500 is exact and can be selected with .bg-blue-500. Attribute selectors like [class*='bg-blue-500'] also work but are less precise.
❓ layout
advanced2:00remaining
Using color system with Tailwind and Flexbox
You want to create a horizontal navigation bar with evenly spaced links that change background color on hover using Tailwind. Which code snippet correctly applies the color system and layout?
Tailwind
<nav class="flex justify-between bg-gray-100 p-4"> <a href="#" class="px-3 py-2 rounded hover:bg-blue-500 hover:text-white">Home</a> <a href="#" class="px-3 py-2 rounded hover:bg-blue-500 hover:text-white">About</a> <a href="#" class="px-3 py-2 rounded hover:bg-blue-500 hover:text-white">Contact</a> </nav>
Attempts:
2 left
💡 Hint
Look for flex layout and hover color classes in Tailwind.
✗ Incorrect
Option D uses Tailwind's flexbox utilities for layout and hover color classes for interactive color changes, following best practices.
❓ accessibility
expert3:00remaining
Ensuring color system accessibility in Tailwind
Which Tailwind approach best ensures that color choices meet accessibility standards for contrast and user readability?
Attempts:
2 left
💡 Hint
Accessibility means good contrast and testing with tools.
✗ Incorrect
Tailwind's predefined palette is designed with contrast in mind, but testing with accessibility tools ensures readability for all users.