← 返回 Skills 市场
ivangdavila

CSS

作者 Iván · GitHub ↗ · v1.0.1
linuxdarwinwin32 ✓ 安全检测通过
1879
总下载
5
收藏
11
当前安装
2
版本数
在 OpenClaw 中安装
/install css
功能描述
Avoid common CSS pitfalls — stacking context, layout quirks, and underused modern features.
使用说明 (SKILL.md)

When to Use

User needs CSS expertise — from layout challenges to production optimization. Agent handles stacking contexts, flexbox/grid patterns, responsive design, performance, and accessibility.

Quick Reference

Topic File
Layout patterns layout.md
Responsive techniques responsive.md
Selectors and specificity selectors.md
Performance optimization performance.md

CSS Philosophy

  • Layout should be robust—work with any content, not just demo content
  • Use modern features—they have better browser support than you think
  • Prefer intrinsic sizing—let content determine size when possible
  • Test with extreme content—longest names, missing images, empty states

Stacking Context Traps

  • z-index only works with positioned elements—or flex/grid children
  • isolation: isolate creates stacking context—contains z-index chaos without position
  • opacity \x3C 1, transform, filter create stacking context—unexpected z-index behavior
  • New stacking context resets z-index hierarchy—child z-index:9999 won't escape parent

Layout Traps

  • Margin collapse only vertical, only block—flex/grid children don't collapse
  • overflow: hidden on flex container can break—use overflow: clip if you don't need scroll

Flexbox Traps

  • flex: 1 means flex: 1 1 0%—basis is 0, not auto
  • min-width: 0 on flex child for text truncation—default min-width is min-content
  • flex-basis vs width: basis is before grow/shrink—width is after, basis preferred
  • gap works in flex now—no more margin hacks for spacing

Grid Traps

  • fr units don't respect min-content alone—use minmax(min-content, 1fr)
  • auto-fit vs auto-fill: fit collapses empty tracks, fill keeps them
  • grid-template-columns: 1fr 1fr is not 50%—it's equal share of REMAINING space
  • Implicit grid tracks can surprise you—items placed outside explicit grid still appear

Responsive Philosophy

  • Start mobile-first—min-width media queries, base styles for mobile
  • Container queries: @container (min-width: 400px)—component-based responsive
  • container-type: inline-size on parent required—for container queries to work
  • Test on real devices—emulators miss touch targets and real performance

Sizing Functions

  • clamp(min, preferred, max) for fluid typography—clamp(1rem, 2.5vw, 2rem)
  • min() and max()width: min(100%, 600px) replaces media query
  • fit-content sizes to content up to max—width: fit-content or fit-content(300px)

Modern Selectors

  • :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 click

Scroll Behavior

  • scroll-behavior: smooth on html—native smooth scroll for anchors
  • overscroll-behavior: contain—prevents scroll chaining to parent/body
  • scroll-snap-type and scroll-snap-align—native carousel without JS
  • scrollbar-gutter: stable—reserves scrollbar space, prevents layout shift

Shorthand Traps

  • inset: 0 equals top/right/bottom/left: 0—less repetition
  • place-items is align-items + justify-itemsplace-items: center centers both
  • margin-inline, margin-block for logical properties—respects writing direction

Performance Mindset

  • contain: layout isolates repaints—use on independent components
  • content-visibility: auto skips offscreen rendering—huge for long pages
  • will-change sparingly—creates layers, uses memory
  • Avoid layout thrash—batch reads and writes to DOM

Accessibility Baseline

  • prefers-reduced-motion: reduce—disable animations for vestibular disorders
  • prefers-color-scheme@media (prefers-color-scheme: dark) for dark mode
  • forced-colors: active—adjust for Windows high contrast
  • Focus indicators must be visible—don't rely on color alone
安全使用建议
This skill is documentation-only and does not request credentials or install software, so it is internally coherent and low risk. Two practical notes: (1) the registry entry has no homepage/source to verify the author — treat it as generic guidance rather than an official library; (2) because the agent may invoke skills autonomously by default, expect it to use this guidance when asked to produce or review CSS. If you need auditability, prefer skills with a verifiable homepage or source repository.
功能分析
Type: OpenClaw Skill Name: css Version: 1.0.1 The skill bundle consists entirely of markdown files (`SKILL.md`, `layout.md`, `performance.md`, `responsive.md`, `selectors.md`) and a metadata file (`_meta.json`). All markdown content provides educational information and best practices related to CSS. There is no executable code, no shell commands, no network calls, no file system operations, and no instructions that could be interpreted as prompt injection against the AI agent to perform unauthorized actions or deviate from its stated purpose of providing CSS expertise. The content is purely informational and aligns with the description of a CSS knowledge skill.
能力评估
Purpose & Capability
The name/description (CSS guidance: stacking contexts, layout, responsive, performance) matches the included SKILL.md and the four topical docs. The skill requires no binaries, env vars, or config paths—everything requested is proportional to a documentation skill.
Instruction Scope
Runtime instructions are purely guidance on CSS topics and reference only the bundled markdown files. There are no commands, file reads outside the bundle, or directions to contact external endpoints or collect credentials.
Install Mechanism
No install spec and no code files are present (instruction-only). Nothing is downloaded or written to disk by the skill itself, which is the lowest-risk install profile.
Credentials
The skill declares no environment variables, no credentials, and no config paths. There are no requests for sensitive tokens or unrelated service keys.
Persistence & Privilege
always is false and the skill is user-invocable (normal). disable-model-invocation is false (agent may call autonomously) — this is the platform default and not flagged here because the skill has no elevated privileges or credential access.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install css
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /css 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Added auxiliary files, Quick Reference, recovered sizing functions, modern selectors, scroll behavior, shorthand traps
v1.0.0
Initial release
元数据
Slug css
版本 1.0.1
许可证
累计安装 11
当前安装数 11
历史版本数 2
常见问题

CSS 是什么?

Avoid common CSS pitfalls — stacking context, layout quirks, and underused modern features. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1879 次。

如何安装 CSS?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install css」即可一键安装,无需额外配置。

CSS 是免费的吗?

是的,CSS 完全免费(开源免费),可自由下载、安装和使用。

CSS 支持哪些平台?

CSS 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。

谁开发了 CSS?

由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.1。

💬 留言讨论