0
0
Tailwindmarkup~5 mins

Custom breakpoints in Tailwind - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AIn tailwind.config.js under theme.extend.screens
BIn your HTML file inside a <style> tag
CIn the package.json file
DIn the tailwind.css file directly
What does the prefix md: mean in Tailwind CSS?
AApply styles only on small screens
BApply styles on medium screens and larger
CApply styles on all screen sizes
DApply styles only on mobile devices
If you add tablet: '640px' as a custom breakpoint, when will tablet:bg-red-500 apply?
AOn all screen sizes
BWhen screen width is less than 640px
COnly on tablets, no matter the size
DWhen screen width is 640px or wider
Why might you want to create a custom breakpoint at 900px?
ATo disable responsiveness
BTo make styles apply only on phones
CTo target devices or layouts that don't fit default breakpoints
DTo make styles apply only on very large screens
How do you write a Tailwind class for a custom breakpoint named laptop?
A<code>laptop:text-lg</code>
B<code>text-lg:laptop</code>
C<code>text-lg</code>
D<code>lg:text-lg</code>
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.