0
0
Tailwindmarkup~20 mins

Custom spacing scale in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Custom Spacing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
Correct syntax to add a custom spacing scale in Tailwind CSS
Which option correctly adds a custom spacing value of 72 equal to 18rem in the Tailwind CSS configuration?
Tailwind
module.exports = {
  theme: {
    extend: {
      spacing: {
        // Your custom spacing here
      }
    }
  }
}
A72: "18rem"
B72: 18rem
C"72": "18rem"
D"72": 18rem
Attempts:
2 left
💡 Hint
Remember that keys in the spacing object should be strings and values should be strings with units.
🧠 Conceptual
intermediate
1:30remaining
Understanding the effect of custom spacing scale
If you add a custom spacing scale "72": "18rem" to your Tailwind config, what will class="p-72" do in your HTML?
AApply padding of 18rem on all sides
BApply padding of 72px on all sides
CApply margin of 18rem on all sides
DApply padding of 72rem on all sides
Attempts:
2 left
💡 Hint
The class p-72 uses the custom spacing value you defined.
selector
advanced
1:30remaining
Custom spacing scale and responsive variants
Given this Tailwind config snippet adding "72": "18rem" to spacing, which class applies a margin of 18rem only on medium screens and larger?
Amd:m-72
Bmargin-md-72
Cm-md-72
Dm-72
Attempts:
2 left
💡 Hint
Tailwind uses prefixes like md: for responsive variants.
layout
advanced
1:30remaining
Using custom spacing scale with Flexbox gap
You added "72": "18rem" to your spacing scale. Which class correctly applies a horizontal gap of 18rem between flex items?
Tailwind
<div class="flex">
  <div>Item 1</div>
  <div>Item 2</div>
</div>
Agap-18rem
Bgap-72-x
Cgap-x-[18rem]
Dgap-x-72
Attempts:
2 left
💡 Hint
Tailwind uses gap-x- for horizontal gaps with spacing keys.
accessibility
expert
2:00remaining
Accessibility considerations when using large custom spacing
You added a very large custom spacing scale "128": "32rem" and use p-128 on a container. What is a potential accessibility concern?
ALarge padding improves readability for all users without any downside
BExcessive padding may cause content to be pushed off screen on small devices, harming usability
CScreen readers will ignore padding, so no accessibility impact
DLarge padding automatically triggers high contrast mode for better accessibility
Attempts:
2 left
💡 Hint
Think about how very large spacing affects small screens and user experience.