Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is the main purpose of the Tailwind CSS configuration file?
The Tailwind CSS configuration file lets you customize default styles, add new colors, fonts, and control how Tailwind generates CSS. It helps you make Tailwind fit your project's design needs.
Click to reveal answer
beginner
Which file name is commonly used for Tailwind CSS configuration?
The common file name is tailwind.config.js. It is a JavaScript file where you define your custom settings for Tailwind.
Click to reveal answer
intermediate
In the Tailwind config file, what is the purpose of the content array?
The <code>content</code> array tells Tailwind which files to scan for class names. This helps Tailwind generate only the CSS you actually use, keeping your styles small and fast.
Click to reveal answer
intermediate
What does the theme section in the Tailwind config file control?
The theme section lets you customize design tokens like colors, spacing, fonts, and more. You can add new values or override defaults to match your design style.
Click to reveal answer
intermediate
How do you extend the default Tailwind theme without replacing it?
You use the extend key inside the theme section. This adds your custom values while keeping the original defaults intact.
Click to reveal answer
What file does Tailwind CSS use by default for configuration?
Astyle.config.js
Btailwind.css
Cconfig.json
Dtailwind.config.js
✗ Incorrect
Tailwind uses tailwind.config.js as its default configuration file.
What is the role of the content array in the Tailwind config file?
ATo set font sizes
BTo list files Tailwind scans for class names
CTo define custom colors
DTo import external CSS files
✗ Incorrect
The content array tells Tailwind which files to scan to find CSS classes you use.
How do you add new colors to Tailwind without removing the default colors?
AUse the <code>extend</code> key inside <code>theme</code>
BReplace the <code>colors</code> key directly
CAdd colors in the <code>content</code> array
DModify the <code>plugins</code> section
✗ Incorrect
Using extend inside theme adds new colors while keeping defaults.
Which language is used to write the Tailwind config file?
AJavaScript
BJSON
CCSS
DHTML
✗ Incorrect
Tailwind config files are JavaScript files, allowing dynamic customization.
What happens if you do not specify the content array in Tailwind config?
B. Colors should be inside extend, not directly under theme
C. fontFamily should not be inside extend
D. Missing comma after colors object
Solution
Step 1: Check placement of colors in config
Directly placing colors under theme overwrites default colors, usually we extend them inside theme.extend.
Step 2: Verify other parts
Content array syntax is correct, fontFamily can be extended inside extend, commas are properly placed.
Final Answer:
Colors should be inside extend, not directly under theme -> Option B
Quick Check:
Extend colors to avoid overwriting defaults [OK]
Hint: Put colors inside theme.extend to keep defaults [OK]
Common Mistakes:
Placing colors directly under theme overwrites defaults
Thinking content syntax is wrong
Misplacing fontFamily outside extend
5. You want to add a new font family called heading and a custom color accent without removing Tailwind's defaults. Which config structure correctly achieves this?