B. Property name should be background-color instead of backgroundColor
C. Function should use addUtilities instead of addComponents
D. Plugin must return a value
Solution
Step 1: Check CSS property names in JS object
Tailwind plugin expects CSS properties in kebab-case strings, not camelCase.
Step 2: Identify the incorrect property
backgroundColor should be background-color as a string key.
Final Answer:
Property name should be background-color instead of backgroundColor -> Option B
Quick Check:
CSS keys in plugins use kebab-case strings = A [OK]
Hint: Use kebab-case CSS property names in plugin objects [OK]
Common Mistakes:
Using camelCase CSS property names
Thinking semicolons are required in JS objects
Confusing addComponents with addUtilities
5. You want to create a Tailwind plugin that adds a new utility class .card-shadow with a subtle box shadow, but only when the screen width is at least 768px. Which approach correctly uses the plugin system to achieve this?
hard
A. Use addUtilities with a media query inside the CSS object for .card-shadow
B. Use addComponents without media queries, then rely on user CSS for responsiveness
C. Add the utility class directly in Tailwind config's extend without a plugin
D. Use addUtilities but media queries are not supported in plugins
Solution
Step 1: Understand how to add responsive utilities in plugins
Plugins can add utilities with media queries by nesting CSS inside the utility object.
Step 2: Identify the correct method
Using addUtilities with a media query inside the CSS object is the correct way.
Final Answer:
Use addUtilities with a media query inside the CSS object for .card-shadow -> Option A
Quick Check:
Media queries inside addUtilities work = A [OK]
Hint: Nest media queries inside addUtilities CSS objects [OK]
Common Mistakes:
Thinking media queries can't be used in plugins
Using addComponents without media queries for utilities
Trying to add utilities only via config extend
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.