Complete the code to import the function needed to add custom utilities in Tailwind CSS.
const plugin = require('[1]');
You need to import plugin from tailwindcss/plugin to create custom utilities.
Complete the code to define a new utility class for a red background using addUtilities.
module.exports = plugin(function({ addUtilities }) {
addUtilities({
'.bg-red-custom': { backgroundColor: '[1]' }
});
});The color code #ff0000 represents red, so it sets the background color to red.
Fix the error in the code to correctly add a utility for text shadow.
module.exports = plugin(function({ addUtilities }) {
addUtilities({
'.text-shadow': { textShadow: [1] }
});
});The value for textShadow must be a string wrapped in quotes. Single quotes or double quotes work, but the code uses single quotes here.
Fill both blanks to add utilities for a blue border and a green text color.
module.exports = plugin(function({ addUtilities }) {
addUtilities({
'.border-blue': { borderColor: '[1]' },
'.text-green': { color: '[2]' }
});
});#0000ff is blue for the border color, and #00ff00 is green for the text color.
Fill all three blanks to add utilities for padding, margin, and a custom font size.
module.exports = plugin(function({ addUtilities }) {
addUtilities({
'.p-10': { padding: '[1]' },
'.m-5': { margin: '[2]' },
'.text-xxl': { fontSize: '[3]' }
});
});Padding .p-10 uses 2.5rem, margin .m-5 uses 1.25rem, and font size .text-xxl uses 3rem.