Problem: Borders with gradients.

Solution#

html
<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

cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns