Recall & Review
beginner
What is a custom breakpoint in Tailwind CSS?
A custom breakpoint is a user-defined screen size where you can apply different styles. It helps make your design responsive by changing layout or styles at specific widths.
Click to reveal answer
beginner
How do you add a custom breakpoint in Tailwind CSS?
You add a custom breakpoint by editing the
tailwind.config.js file and adding a new key with a screen size value inside the theme.extend.screens section.Click to reveal answer
beginner
Example: What does this custom breakpoint mean?
sm: '480px'It means styles with the prefix
sm: will apply when the screen width is 480 pixels or wider.Click to reveal answer
intermediate
Why use custom breakpoints instead of default ones?
Custom breakpoints let you match your design needs exactly. Default breakpoints might not fit your layout or device targets, so custom ones give more control.Click to reveal answer
beginner
How do you apply styles for a custom breakpoint named
tablet?Use the prefix <code>tablet:</code> before your class name, like <code>tablet:bg-blue-500</code>. This applies the style only when the screen matches the <code>tablet</code> breakpoint.Click to reveal answer
Where do you define custom breakpoints in Tailwind CSS?
✗ Incorrect
Custom breakpoints are set in the tailwind.config.js file inside the theme.extend.screens section.
What does the prefix
md: mean in Tailwind CSS?✗ Incorrect
The
md: prefix applies styles when the screen width is medium or larger.If you add
tablet: '640px' as a custom breakpoint, when will tablet:bg-red-500 apply?✗ Incorrect
The style applies when the screen width is at least 640 pixels.
Why might you want to create a custom breakpoint at 900px?
✗ Incorrect
Custom breakpoints help target specific screen sizes that default breakpoints don't cover well.
How do you write a Tailwind class for a custom breakpoint named
laptop?✗ Incorrect
You prefix the class with the breakpoint name and a colon, like
laptop:text-lg.Explain how to add and use a custom breakpoint in Tailwind CSS.
Think about where Tailwind stores config and how prefixes work.
You got /4 concepts.
Why are custom breakpoints useful in responsive design with Tailwind CSS?
Consider limitations of default breakpoints.
You got /4 concepts.