Recall & Review
beginner
What are arbitrary values in Tailwind CSS?
Arbitrary values let you use custom styles not included in Tailwind's default set by writing them directly in square brackets, like <code>bg-[#123456]</code> for a custom color.Click to reveal answer
beginner
Why does Tailwind allow arbitrary values?
Because sometimes you need a style that Tailwind doesn’t have built-in. Arbitrary values let you add those exact styles without writing extra CSS files.Click to reveal answer
intermediate
How do arbitrary values improve developer experience?
They save time by letting you write one-off styles quickly in your HTML or JSX, avoiding switching between files or writing custom CSS.
Click to reveal answer
beginner
Give an example of an arbitrary value for padding in Tailwind.
You can write
p-[13px] to set padding exactly to 13 pixels, even if Tailwind doesn’t have that size predefined.Click to reveal answer
intermediate
What is a potential downside of using too many arbitrary values?
Using many arbitrary values can make your code harder to read and maintain because styles are less consistent and harder to find in one place.
Click to reveal answer
What syntax does Tailwind use for arbitrary values?
✗ Incorrect
Tailwind uses square brackets to wrap arbitrary values, for example
text-[20px].Why might you use an arbitrary value instead of a default Tailwind class?
✗ Incorrect
Arbitrary values let you use custom sizes or colors not in Tailwind’s default set.
Which of these is a valid arbitrary value for background color in Tailwind?
✗ Incorrect
The correct syntax uses square brackets:
bg-[#ff5733].What is a risk of overusing arbitrary values?
✗ Incorrect
Too many arbitrary values can make your code messy and inconsistent.
How do arbitrary values help with responsive design?
✗ Incorrect
You can use arbitrary values with responsive prefixes to set custom styles at different screen sizes.
Explain why Tailwind CSS includes arbitrary values and how they help developers.
Think about times when you need a style Tailwind doesn’t have.
You got /4 concepts.
Describe the syntax for using arbitrary values in Tailwind and give two examples.
Remember the brackets and how you write the value inside.
You got /3 concepts.