Skip to content
Skillpedia
Websites & UI (frontend)7.2k · #13419

css-border-gradient

What it does

This skill gives an AI agent CSS patterns for gradient borders on premium web surfaces. It is for designers who want a subtle edge highlight on cards, pricing panels and hero areas.

When to use it

  • ✓When a card, pricing panel or modal looks too plain with a flat border.
  • ✓When you want a quiet brand accent on a hover or focus state.
  • ✓When a dark glass or hero surface needs a more refined edge.

Skill link

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/css-border-gradient/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/css-border-gradient/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Give my pricing cards a thin gradient border that catches the light, but keep it subtle.”

5 new skills a week. 1 minute to read.

How it works

The agent layers a CSS background behind the fill so a soft gradient shows as a thin edge. It has a simple version for solid surfaces and a masked version for surfaces that already have a background.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Border Gradients

Use When

  • A surface needs a more premium edge than a flat border.
  • Dark glass, pricing, hero, modal, or feature-card UI feels too plain.
  • A hover or focus state needs a quiet brand accent.

Defaults

  • Width: 1px; use 2px only for large hero cards or active states.
  • Radius: inherit the parent radius.
  • Angle: 135deg or 160deg.
  • Stops: neutral highlight, one brand accent, neutral fade.
  • Opacity: keep most stops below 0.4; subtle beats shiny.

Simple CSS Pattern

Use this when the surface has a solid or translucent fill.

.gradient-border {
  --surface: rgba(10, 14, 24, 0.72);
  --border-a: rgba(255, 255, 255, 0.34);
  --border-b: rgba(125, 92, 255, 0.36);
  --border-c: rgba(255, 255, 255, 0.08);

  border: 1px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--border-a), var(--border-b), var(--border-c)) border-box;
}
<div class="gradient-border">
  ...
</div>

Masked Pattern

Use this when the surface already has a complex background that should not be overwritten.

.gradient-border-mask {
  position: relative;
  border-radius: 20px;
}

.gradient-border-mask::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.34),
    rgba(125, 92, 255, 0.36) 45%,
    rgba(255, 255, 255, 0.08)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

Tailwind Shortcut

Use arbitrary properties for one-off surfaces.

<div class="rounded-2xl border border-transparent [background:linear-gradient(rgba(10,14,24,.72),rgba(10,14,24,.72))_padding-box,linear-gradient(135deg,rgba(255,255,255,.34),rgba(125,92,255,.36),rgba(255,255,255,.08))_border-box]">
  ...
</div>

Taste Rules

  • Apply to one hierarchy level at a time: primary card, active tab, selected plan, or hero panel.
  • Do not use rainbow borders, full-saturation neon, or animated gradients by default.
  • Keep the border quieter than the content. It should frame, not compete.
  • Pair with restrained depth: a soft shadow or inner highlight is enough.
  • Check light and dark themes separately; the same alpha rarely works for both.

Quick Checks

  • No double border from an existing border-color.
  • Radius matches the surface exactly.
  • The gradient is visible at normal zoom but barely noticeable when scanning.
  • Focus states remain accessible and do not rely only on the gradient.
FAQ

Will the border be bright?

The skill keeps most of the gradient colors faint, so the edge stays subtle rather than shiny.

What if the card already has a background image?

The skill has a masked version that leaves the existing background untouched.

What width is used?

The default is a 1 pixel border, and 2 pixels is used only for large hero cards or active states.

Details

Original description by the author

Apply subtle gradient-border treatments for premium web surfaces. Use when cards, pricing panels, nav bars, modals, buttons, or hero surfaces need a refined edge highlight without a loud glow.

repo: MengTo/Skills

Popularity

GitHub stars
7.2k
Ranking position
#13419
License
MIT
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills