Problem: Borders with gradients.
Solution#
<div class="rounded-xl bg-gradient-to-r from-blue-500 to-fuchsia-500 p-[2px]">
<div class="rounded-[10px] bg-white p-6">content</div>
</div>Why this works#
Gradient wrapper + inner surface + padding gap = gradient border.
Variants#
- Responsive: add screen prefixes to the core classes
- Dark: pair each color utility with its dark: twin
- Animated: add
transition+ a state variant for motion
Related recipes#
cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns
