css-border-gradient
它能做什么
这个技能为 AI 智能体提供 CSS 渐变边框的写法,适用于高端网页界面。适合希望为卡片、定价面板和主视觉区域添加柔和边缘高光的设计师。
适用场景
- ✓当卡片、定价面板或弹窗因为扁平边框而显得太普通时。
- ✓当你希望在悬停或聚焦状态下加入低调的品牌强调时。
- ✓当深色玻璃或主视觉表面需要更精致的边缘时。
技能链接
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/css-border-gradient/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我给定价卡片加一圈细细的渐变边框,让它能捕捉光线,但保持低调。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在填充色后方叠加一层 CSS 背景,使柔和的渐变显示为细边。它有适用于纯色表面的简单版本,也有适用于已有背景表面的遮罩版本。
技术内容(原始 SKILL.md)
作者在 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; use2pxonly for large hero cards or active states. - Radius: inherit the parent radius.
- Angle:
135degor160deg. - 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.
常见问题
边框会很亮吗?
该技能会让大部分渐变颜色保持淡雅,使边缘保持柔和,而不是闪亮。
如果卡片已有背景图怎么办?
该技能提供遮罩版本,可以保持原有背景不变。
边框宽度是多少?
默认宽度为 1 像素,只有在大型主视觉卡片或激活状态下才使用 2 像素。
详情
作者的原始描述
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
热度
- GitHub 星标
- 7.2k
- 排名
- #13419
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
3d-cloth-material
7.2k帮你的智能体在 Three.js 中制作逼真的编织织物,包括纱线编织纹理、柔和光泽、自然褶皱、下摆和缝线。
3d-falling-leaves
7.2k帮你的智能体在 3D 场景中添加逼真的飘落树叶,树叶会翻滚、随风飘动,并在镜头移动时循环利用。
3d-four-seasons
7.2k帮你的智能体为 3D 场景添加春夏秋冬四季效果,无需重建场景即可改变植被、光线、天空和积雪。
3d-high-poly-models
7.2k帮你的智能体构建形状平滑、边缘可信的精细 3D 模型,然后制作在网页上运行流畅的轻量版本。