0
0
Tailwindmarkup~20 mins

Configuration file structure in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tailwind Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
Identify the correct way to extend colors in Tailwind config
Which option correctly extends the default Tailwind colors with a custom blue shade in tailwind.config.js?
Amodule.exports = { theme: { extend: { colors: { blue: '#1E40AF' } } } }
Bmodule.exports = { extend: { theme: { colors: { blue: '#1E40AF' } } } }
Cmodule.exports = { theme: { colors: { extend: { blue: '#1E40AF' } } } }
Dmodule.exports = { theme: { extend: { blue: { colors: '#1E40AF' } } } }
Attempts:
2 left
💡 Hint
Remember that extend is a key inside theme to add or override values.
🧠 Conceptual
intermediate
1:30remaining
Understanding the purpose of the content key in Tailwind config
What is the main role of the content array in the tailwind.config.js file?
AIt lists the plugins to be used by Tailwind.
BIt defines the colors and fonts used in the project.
CIt tells Tailwind which files to scan for class names to generate CSS.
DIt specifies the output folder for the compiled CSS files.
Attempts:
2 left
💡 Hint
Think about how Tailwind knows which styles to include in the final CSS.
selector
advanced
2:00remaining
Which Tailwind config snippet correctly adds a custom font family?
Select the option that properly adds a custom font family named heading with the value 'Georgia', serif in the Tailwind config.
Amodule.exports = { theme: { fontFamily: { extend: { heading: ['Georgia', 'serif'] } } } }
Bmodule.exports = { theme: { extend: { fontFamily: { heading: ['Georgia', 'serif'] } } } }
Cmodule.exports = { extend: { theme: { fontFamily: { heading: ['Georgia', 'serif'] } } } }
Dmodule.exports = { theme: { extend: { fontFamily: { 'heading': 'Georgia, serif' } } } }
Attempts:
2 left
💡 Hint
Remember the structure: theme then extend then the property to add or override.
layout
advanced
2:00remaining
How to configure Tailwind to add a custom grid template column layout?
Which option correctly adds a custom grid template column named sidebar-main with columns 250px 1fr in the Tailwind config?
Amodule.exports = { theme: { gridTemplateColumns: { extend: { 'sidebar-main': '250px 1fr' } } } }
Bmodule.exports = { extend: { theme: { gridTemplateColumns: { 'sidebar-main': '250px 1fr' } } } }
Cmodule.exports = { theme: { extend: { gridTemplateColumns: { sidebarMain: '250px 1fr' } } } }
Dmodule.exports = { theme: { extend: { gridTemplateColumns: { 'sidebar-main': '250px 1fr' } } } }
Attempts:
2 left
💡 Hint
Check the correct nesting and the exact key names including quotes and casing.
accessibility
expert
2:30remaining
How to configure Tailwind to support dark mode using class strategy?
Which Tailwind config snippet correctly enables dark mode using the class strategy?
Amodule.exports = { darkMode: 'class', theme: { extend: {} } }
Bmodule.exports = { darkMode: true, theme: { extend: {} } }
Cmodule.exports = { darkMode: 'media', theme: { extend: {} } }
Dmodule.exports = { darkMode: false, theme: { extend: {} } }
Attempts:
2 left
💡 Hint
Dark mode can be triggered by a CSS media query or by a class on the root element.