Local config overrides preset values when keys conflict, so local primary color '#ff0000' overrides preset '#00ff00'.
Step 2: Determine final color for bg-primary
The div uses the local config color '#ff0000' (red).
Final Answer:
#ff0000 (red) from local config -> Option A
Quick Check:
Local config overrides preset colors [OK]
Hint: Local theme colors override preset colors [OK]
Common Mistakes:
Assuming preset colors override local config
Thinking conflicting keys cause errors
Believing class won't apply without explicit import
4. You added a preset in tailwind.config.js but your styles from the preset are not applying. What is the most likely mistake?
medium
A. Using preset instead of presets in config
B. Forgetting to export the preset module with module.exports
C. Not installing Tailwind CSS in the project
D. Adding presets inside the theme object
Solution
Step 1: Check common config mistakes
Using preset (singular) instead of presets (plural) means Tailwind ignores the preset array.
Step 2: Validate other options
Forgetting to export the preset module with module.exports is possible but less common; C and D are unrelated to preset loading.
Final Answer:
Using preset instead of presets in config -> Option A
Quick Check:
Correct property name is 'presets' [OK]
Hint: Use 'presets' plural, not 'preset' singular [OK]
Common Mistakes:
Misspelling 'presets' as 'preset'
Placing presets inside wrong config section
Not exporting preset module properly
5. You want to share a preset that includes custom fonts and colors across three projects. Which approach ensures all projects use the preset and can override colors if needed?
hard
A. Use Tailwind's CDN link with custom fonts and colors embedded
B. Copy the preset config file into each project and import it manually in CSS files
C. Write the preset config directly inside each project's tailwind.config.js without sharing
D. Create a separate npm package with the preset and add it in each project's presets array; override colors locally as needed
Solution
Step 1: Identify best sharing method
Creating a separate npm package for the preset allows easy reuse and updates across projects.
Step 2: Confirm override capability
Adding the preset in presets array lets each project override colors locally without changing the shared preset.
Final Answer:
Create a separate npm package with the preset and add it in each project's presets array; override colors locally as needed -> Option D
Quick Check:
npm package + presets array + local overrides = best practice [OK]
Hint: Use npm package for preset + local overrides [OK]
Common Mistakes:
Copying preset files manually causing duplication
Embedding config directly without sharing
Using CDN which can't share config presets
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.