flavors
Images3DToolsPricingSponsor
← All Flavors Free Tools

Gradient Border CSS Generator

Linear or conic stops, rounded corners, transparent or opaque cards and a rotating option. Previewed on dark and light, exported as raw CSS or Tailwind v4.

Presets
Dark
Pro plan$9/moRemix, REST + MCP, no sponsors.
Light
Pro plan$9/moRemix, REST + MCP, no sponsors.
Raw CSS
.gradient-border {
  border: 2px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(#0e0e11, #0e0e11) padding-box,
    linear-gradient(135deg, #ff5f6d 0%, #ffc371 50%, #a855f7 100%) border-box;
}
Tailwind v4
<div class="rounded-[20px] border-[2px] border-transparent [background:linear-gradient(#0e0e11,#0e0e11)_padding-box,linear-gradient(135deg,_#ff5f6d_0%,_#ffc371_50%,_#a855f7_100%)_border-box]">…</div>
Technique
Gradient
Motion
Color stops
#ff5f6d0%
#ffc37150%
#a855f7100%
Flavors Pro · $49/yr or $9/mo

Need a complete UI system around this border?

Pair this border with complete AI-ready UI design languages, 3D hero components, Tailwind v4 themes, and REST + MCP access.

Unlock full kits in Flavors ProSign in straight to $49/yr checkout

FAQ

How do I make a gradient border with border-radius in CSS?

border-image ignores border-radius, so a rounded gradient border needs another technique. For an opaque card, stack two backgrounds: a solid fill clipped to padding-box and the gradient clipped to border-box, with a transparent border. For a transparent card, draw the gradient on a ::before layer and cut the middle out with mask-composite: exclude.

How do I get a gradient border on a transparent background?

Use the mask-composite technique. A ::before pseudo-element carries the gradient with padding equal to the border width, then two masks (content-box and full box) are composited with exclude, leaving only the ring. The card's background stays fully transparent.

How do I animate a rotating gradient border?

Register a custom property with @property --border-angle as an <angle>, use it as the gradient direction (conic-gradient(from var(--border-angle), …)), then animate it with @keyframes. Without @property the browser can't interpolate the angle, so the border would jump instead of rotate.

Does it work with Tailwind CSS v4?

Yes. The generator outputs arbitrary-value utilities such as [background:…_padding-box,…_border-box] and before:mask-exclude, plus an @theme animation token when rotation is on. Paste the markup and, for animation, the snippet into globals.css.

What is the browser support for CSS gradient borders?

All evergreen browsers. mask-composite: exclude ships unprefixed in Chrome 120+, Safari 15.4+ and Firefox 53+; the -webkit-mask-composite: xor line covers older WebKit. @property is supported in all current browsers.

More Free Design Tools

View all tools →
16 Google Font pairs

Google Font Pairings Generator

16 curated Google Font heading + body pairings with live editable preview, Google Fonts link & Tailwind v4.

Open tool
5-layer shadows

CSS Box Shadow Generator

Multi-layer CSS box-shadow studio with 8 curated presets, inset support & Tailwind utility export.

Open tool
WCAG AA/AAA

WCAG Color Contrast Checker

Check WCAG AA/AAA & UI contrast in HEX, RGB or OKLCH and auto-fix failing pairs in one click.

Open tool
70s · 80s · 90s · Y2K

Retro Color Palette Generator

70s groove, 80s synthwave, 90s Memphis, Y2K Chrome, Mid-Century, Bauhaus & Kodak Film palettes.

Open tool
Curated moods & WCAG

Aesthetic Color Palette Generator

Matcha & Cream, Dark Academia, Japandi, Pastel Dream & harmony sliders with WCAG badges.

Open tool
HTML · BRAND.md · CSS

Brand Guidelines Generator

Build a live mini brand book and export HTML brand sheet, BRAND.md or CSS design tokens.

Open tool
50–950 OKLCH scales

Tailwind v4 Palette Generator

Perceptually uniform 50–950 Tailwind v4 OKLCH scales and dark-mode palettes.

Open tool
HEX ↔ OKLCH

OKLCH Color Converter

Convert HEX to OKLCH and OKLCH to HEX with live Lightness, Chroma & Hue sliders.

Open tool
Frosted glass CSS

CSS Glassmorphism Generator

Frosted-glass CSS & Tailwind v4 cards with live backdrop-filter blur and saturation.

Open tool

flavors · a vibe is not a template · © 2026

FlavorsImages3DFree ToolsPricingBlogAboutContactSponsorChangelogReport BugCommunityPrivacyTermsAffiliates
Popular toolsGoogle Font PairingsBox Shadow GeneratorColor Contrast CheckerRetro Color PaletteAesthetic PaletteBrand GuidelinesGradient Border CSS