0
0
Tailwindmarkup~10 mins

@apply for extracting patterns in Tailwind - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to apply padding and background color using Tailwind's @apply.

Tailwind
.btn {
  @apply [1];
}
Drag options to blanks, or click blank then click option'
Atext-center font-bold
Bm-2 border-2
Cflex items-center
Dp-4 bg-blue-500
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated utilities like text alignment or flexbox.
Forgetting to separate utilities with spaces.
2fill in blank
medium

Complete the code to extract common text styles using @apply in a CSS class.

Tailwind
.text-style {
  @apply [1];
}
Drag options to blanks, or click blank then click option'
Atext-lg font-semibold text-gray-700
Bp-6 bg-red-300 rounded
Cflex justify-center items-center
Dborder border-gray-400 shadow-md
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing layout or spacing utilities instead of text styles.
Mixing unrelated utilities in the @apply directive.
3fill in blank
hard

Fix the error in the @apply usage to combine flexbox and spacing utilities.

Tailwind
.container {
  @apply [1];
}
Drag options to blanks, or click blank then click option'
Aflex, justify-center, p-4
Bflex justify-center p-4
Cflex; justify-center; p-4
Dflex;justify-center;p-4
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons to separate utilities.
Writing utilities without spaces.
4fill in blank
hard

Fill both blanks to create a reusable card style with shadow and padding using @apply.

Tailwind
.card {
  @apply [1] [2];
}
Drag options to blanks, or click blank then click option'
Ashadow-lg
Bp-6
Ctext-center
Dbg-gray-100
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing text alignment or background color instead of shadow or padding.
Mixing unrelated utilities.
5fill in blank
hard

Fill all three blanks to create a button style with rounded corners, background color, and text color using @apply.

Tailwind
.btn-primary {
  @apply [1] [2] [3];
}
Drag options to blanks, or click blank then click option'
Arounded-md
Bbg-green-600
Ctext-white
Dborder-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using border utilities instead of rounded corners.
Mixing background and text colors incorrectly.