Avoid common CSS pitfalls — stacking context, layout quirks, and underused modern features.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install css或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install css⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/css/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: CSS slug: css version: 1.0.1 description: Write modern CSS with proper stacking contexts, layout patterns, responsive techniques, and performance optimization. metadata: {"clawdbot":{"emoji":"🎨","os":["linux","darwin","win32"]}} ---
User needs CSS expertise — from layout challenges to production optimization. Agent handles stacking contexts, flexbox/grid patterns, responsive design, performance, and accessibility.
| Topic | File | |-------|------| | Layout patterns | layout.md | | Responsive techniques | responsive.md | | Selectors and specificity | selectors.md | | Performance optimization | performance.md |
z-index only works with positioned elements—or flex/grid childrenisolation: isolate creates stacking context—contains z-index chaos without positionopacity < 1, transform, filter create stacking context—unexpected z-index behavioroverflow: hidden on flex container can break—use overflow: clip if you don't need scrollflex: 1 means flex: 1 1 0%—basis is 0, not automin-width: 0 on flex child for text truncation—default min-width is min-contentflex-basis vs width: basis is before grow/shrink—width is after, basis preferredgap works in flex now—no more margin hacks for spacingfr units don't respect min-content alone—use minmax(min-content, 1fr)auto-fit vs auto-fill: fit collapses empty tracks, fill keeps themgrid-template-columns: 1fr 1fr is not 50%—it's equal share of REMAINING spacemin-width media queries, base styles for mobile@container (min-width: 400px)—component-based responsivecontainer-type: inline-size on parent required—for container queries to workclamp(min, preferred, max) for fluid typography—clamp(1rem, 2.5vw, 2rem)min() and max()—width: min(100%, 600px) replaces media queryfit-content sizes to content up to max—width: fit-content or fit-content(300px):is() for grouping—:is(h1, h2, h3) + p less repetition:where() same as :is() but zero specificity—easier to override:has() parent selector—.card:has(img) styles card containing image:focus-visible for keyboard focus only—no outline on mouse clickscroll-behavior: smooth on html—native smooth scroll for anchorsoverscroll-behavior: contain—prevents scroll chaining to parent/bodyscroll-snap-type and scroll-snap-align—native carousel without JSscrollbar-gutter: stable—reserves scrollbar space, prevents layout shiftinset: 0 equals top/right/bottom/left: 0—less repetitionplace-items is align-items + justify-items—place-items: center centers bothmargin-inline, margin-block for logical properties—respects writing directioncontain: layout isolates repaints—use on independent componentscontent-visibility: auto skips offscreen rendering—huge for long pageswill-change sparingly—creates layers, uses memoryprefers-reduced-motion: reduce—disable animations for vestibular disordersprefers-color-scheme—@media (prefers-color-scheme: dark) for dark modeforced-colors: active—adjust for Windows high contrast安装 CSS 后,可以对 AI 说这些话来触发它
Help me get started with CSS
Explains what CSS does, walks through the setup, and runs a quick demo based on your current project
Use CSS to avoid common CSS pitfalls — stacking context, layout quirks, and un...
Invokes CSS with the right parameters and returns the result directly in the conversation
What can I do with CSS in my documents & notes workflow?
Lists the top use cases for CSS, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/css/ 目录(个人级,所有项目可用),或 .claude/skills/css/(项目级)。重启 AI 客户端后,用 /css 主动调用,或让 AI 根据上下文自动发现并使用。
CSS 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
CSS 可免费安装使用。请查阅仓库了解许可证信息。
Avoid common CSS pitfalls — stacking context, layout quirks, and underused modern features.
CSS 属于「Documents & Notes」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my documents & notes tasks using CSS
Identifies repetitive steps in your workflow and sets up CSS to handle them automatically