HTML & CSS · Middle · Question 44 of 75
What are group and peer for in Tailwind?
- 1For combining several utilities into one reusable class, like
@apply - ✓Correct answer: For styling based on a parent's state (
group-hover:) or a sibling's (peer-checked:) - 3For grouping several media queries under one breakpoint
Explanation
Put group on the parent and write group-hover:text-white on a descendant - the style applies when the parent is hovered. peer works for following siblings: <input class="peer"> + <p class="peer-invalid:visible">. Combining classes into one is @apply.