Gradient Border Recipes & Quick Patterns
A library of ready-to-use gradient border combinations. Each recipe shows the rendered look, the parameters that produced it, and the exact CSS you can copy. Load any recipe directly into the generator above with one click of its preset button.
How to Use the Generator
- Pick gradient type — Linear for directional fades, Conic for sweeping circular effects.
- Add color stops — Click "+ Add Color Stop", drag the position slider to space each color.
- Tune width, radius, padding — Most UI uses 1–4px borders with 8–24px corner radius.
- Set the inner background — This must be a solid color the gradient frames; transparency isn't possible with the rounded-corner method.
- Copy as CSS, Tailwind, or SCSS — Whichever your project uses.
Card & UI Recipes
- Subtle brand card — Linear 135°, 2px border, 16px radius, two-stop fade from your primary to a softer accent. Goes everywhere; doesn't shout.
- Premium spotlight — Linear 90°, 1px border, 12px radius, three-stop with a bright color stop placed at 50%. Looks like a horizontal sheen across the top edge.
- Pricing tier emphasis — Linear 135°, 3px border, 20px radius, two-stop with bold contrasting colors. Use only on the recommended tier to draw the eye.
- Hover-only border — Make the border transparent by default, swap to gradient on hover with a 0.2s transition on background. Crisp affordance without permanent visual weight.
Button Recipes
- Outline-only CTA — 2px border, 999px radius (pill), transparent dark inner. Gradient on the border only, text in the gradient's brightest color. Perfect for secondary CTAs.
- Animated rotating border — Use the conic-gradient option with a 4s rotation animation. Strong attention-grabber for high-priority actions.
- Gradient outline on focus — Default border is your usual UI border; on
:focus-visible, swap to gradient. Combines accessibility with brand polish.
Color Combinations That Work
Hand-picked pairings that consistently look professional. Click any in the generator's preset grid above to load it.
- Violet → Pink (Neon) —
#7c6fff → #ff6fb0. Default brand-friendly pair.
- Sunset —
#ff6b6b → #feca57. Warm, energetic; great for hero sections.
- Ocean —
#36d1dc → #5b86e5. Calm and trustworthy; financial / SaaS feel.
- Mint —
#00b09b → #96c93d. Fresh and outdoorsy; wellness / eco brands.
- Gold —
#f7971e → #ffd200. Premium emphasis without being garish.
- Rainbow Conic — Full spectrum on the conic type. Use sparingly for accent moments (badges, achievements).
Choosing Border Width
| Width | When to use |
| 1px | Subtle separation between cards in dense lists. Reads almost as a thin line. |
| 2px | Default for most UI. Visible but not heavy. |
| 3px | Marketing emphasis — hero cards, pricing highlights, callout boxes. |
| 4–6px | Conic gradients only — they need thickness for the sweep to be visible. |
| 8px+ | Display/poster effects, not production UI. |
Tailwind Setup
Tailwind doesn't have a gradient-border utility out of the box. The generator's Tailwind output uses arbitrary value syntax which works without any config changes. If you want a reusable utility, add this to your tailwind.config.js:
// tailwind.config.js
module.exports = {
theme: {
extend: {
backgroundImage: {
'gradient-border-neon': 'linear-gradient(#0a0a0f, #0a0a0f) padding-box, linear-gradient(135deg, #7c6fff, #ff6fb0) border-box'
}
}
}
}
Then use as class="border-2 border-transparent bg-gradient-border-neon".
Troubleshooting
- Corners aren't rounded — Switch from border-image to background-clip mode in the generator. border-image ignores
border-radius by design.
- The inside isn't transparent — Correct, by design. The background-clip technique needs a solid inner color. If you genuinely need transparency, use an SVG with a stroke instead.
- Animated border flickers in Safari — Add
will-change: background-position to the animated element.
- Border looks pixelated on retina — Use whole-pixel widths and avoid sub-pixel offsets.
1.5px borders render inconsistently.
- Background bleeds through in old Safari — Add
-webkit-background-clip: padding-box, border-box alongside the standard property.
Want the full theory behind gradient borders — how each technique works, why CSS doesn't support them natively, and the evolution from border-image to the modern double-background method? Read our in-depth article: The complete guide to CSS gradient borders →