Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)7.2k · #13419

css-border-gradient

Skill này làm gì

Skill này cung cấp cho agent các mẫu CSS để làm viền gradient cho bề mặt web cao cấp. Nó dành cho nhà thiết kế muốn một điểm sáng viền tinh tế trên thẻ, bảng giá và khu vực hero.

Khi nào nên dùng

  • ✓Khi một thẻ, bảng giá hoặc modal trông quá đơn giản với viền phẳng.
  • ✓Khi bạn muốn một điểm nhấn thương hiệu kín đáo khi hover hoặc focus.
  • ✓Khi một bề mặt kính tối hoặc khu vực hero cần viền tinh tế hơn.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/css-border-gradient/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Cho thẻ giá của tôi một viền gradient mảnh bắt sáng, nhưng giữ tinh tế.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent xếp một nền CSS phía sau phần tô để một gradient mềm hiện thành viền mảnh. Có một phiên bản đơn giản cho bề mặt đặc và một phiên bản dùng mask cho bề mặt đã có nền.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.
Câu hỏi thường gặp

Viền có sáng quá không?

Skill giữ phần lớn màu gradient nhạt, nên viền tinh tế thay vì bóng loáng.

Nếu thẻ đã có ảnh nền thì sao?

Skill có phiên bản dùng mask giữ nguyên nền có sẵn.

Độ rộng là bao nhiêu?

Mặc định là viền 1 pixel, và 2 pixel chỉ dùng cho thẻ hero lớn hoặc trạng thái đang hoạt động.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
7.2k
Vị trí xếp hạng
#13419
Giấy phép
MIT
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự