0
0
Tailwindmarkup~5 mins

Why arbitrary values exist in Tailwind - Quick Recap

Choose your learning style9 modes available
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?
ACurly braces around the value, like <code>text-{20px}</code>
BNo special syntax, just write the value directly
CParentheses around the value, like <code>text-(20px)</code>
DSquare brackets around the value, like <code>text-[20px]</code>
Why might you use an arbitrary value instead of a default Tailwind class?
ATo use a style size or color not included in Tailwind's presets
BBecause arbitrary values are faster to load
CTo avoid writing any CSS at all
DBecause Tailwind does not support responsive design
Which of these is a valid arbitrary value for background color in Tailwind?
Abg-(#ff5733)
Bbg-[#ff5733]
Cbg-{#ff5733}
Dbg-ff5733
What is a risk of overusing arbitrary values?
ACode becomes harder to maintain and less consistent
BTailwind will stop working
CYour website will load slower
DYou cannot use responsive design anymore
How do arbitrary values help with responsive design?
AThey disable responsiveness for that element
BThey automatically adjust sizes on different screens
CYou can combine them with responsive prefixes like <code>md:p-[15px]</code>
DThey replace media queries
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.