Challenge - 5 Problems
Tailwind Theme Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding theme extension in Tailwind CSS
What happens when you add new colors inside the
extend section of the Tailwind theme configuration?Tailwind
module.exports = {
theme: {
extend: {
colors: {
brandBlue: '#1fb6ff'
}
}
}
}Attempts:
2 left
💡 Hint
Think about how
extend works compared to overriding the whole theme.✗ Incorrect
Using
extend inside the theme adds new values to the existing default theme without removing them. This means you keep all default colors and add your custom ones.📝 Syntax
intermediate2:00remaining
Correct syntax for extending font sizes
Which option correctly extends the default font sizes by adding a new size called
xxs with value 0.65rem?Tailwind
module.exports = {
theme: {
extend: {
fontSize: {
xxs: '0.65rem'
}
}
}
}Attempts:
2 left
💡 Hint
Check the exact property name and value format Tailwind expects.
✗ Incorrect
The correct property is
fontSize (singular), and values must be strings with units like rem. Option A matches this exactly.❓ rendering
advanced2:00remaining
Visual effect of extending spacing scale
If you extend the spacing scale with
72: '18rem' and use class="mt-72" on a div, what will you see?Tailwind
module.exports = {
theme: {
extend: {
spacing: {
'72': '18rem'
}
}
}
}Attempts:
2 left
💡 Hint
Remember how Tailwind spacing keys can be numbers as strings and map to CSS sizes.
✗ Incorrect
Extending spacing with key
72 and value 18rem adds a new margin/padding size. Using mt-72 applies margin-top of 18rem, which is a large vertical space.❓ selector
advanced2:00remaining
Using extended colors in Tailwind selectors
After extending the colors with
brandRed: '#e3342f', which class applies the background color correctly?Tailwind
module.exports = {
theme: {
extend: {
colors: {
brandRed: '#e3342f'
}
}
}
}Attempts:
2 left
💡 Hint
Tailwind class names are case sensitive and use kebab-case for multi-word names.
✗ Incorrect
Tailwind uses the exact key name for colors in class names, preserving case. Since the key is
brandRed, the class is bg-brandRed. Other options are invalid or misspelled.❓ accessibility
expert3:00remaining
Ensuring accessible color contrast with extended theme colors
You extended Tailwind colors with
softGreen: '#a8d5ba'. Which approach best ensures text using text-softGreen is accessible on a white background?Tailwind
module.exports = {
theme: {
extend: {
colors: {
softGreen: '#a8d5ba'
}
}
}
}Attempts:
2 left
💡 Hint
Think about how font weight affects color contrast and readability.
✗ Incorrect
Light colors on white backgrounds can be hard to read. Making text bold increases contrast and improves accessibility. Simply using the color alone or adding opacity reduces contrast. Underline does not affect color contrast.