Complete the code to set a custom primary color in Tailwind CSS.
module.exports = {
theme: {
extend: {
colors: {
primary: '[1]'
}
}
}
}The primary color must be a valid color value like a hex code. Here, #1DA1F2 is a hex color code for a blue shade.
Complete the code to apply the custom primary color as background in a Tailwind class.
<div class="bg-[1] p-4 text-white">Hello!</div>
When you define a custom color named 'primary' in Tailwind, you use it as bg-primary in class names. Here, only 'primary' fits after 'bg-'.
Fix the error in the Tailwind config to properly extend the font family.
module.exports = {
theme: {
extend: {
fontFamily: [1]
}
}
}The fontFamily property expects an object with keys as font family names and values as arrays of font names. Option A is the correct format.
Fill both blanks to create a custom spacing scale and use it in padding.
<div class="p-[1]">Content</div> module.exports = { theme: { extend: { spacing: { '[2]': '3.5rem' } } } }
The spacing key '14' corresponds to the class p-14. Defining '14' in spacing with '3.5rem' allows using p-14 for padding.
Fill all three blanks to create a custom box shadow and apply it in a class.
module.exports = {
theme: {
extend: {
boxShadow: {
'[1]': '[2]'
}
}
}
}
<div class="shadow-[3] p-4">Box Shadow Example</div>The custom box shadow is named 'custom' in the config and used as shadow-custom in the class. The value is the shadow CSS string.