Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

web-cssWEB CSS 搜索

Agent Skill

web-css 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

456

周安装

19

GitHub Stars

1

下载量

152
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:web-css(WEB CSS 搜索)
来源仓库:https://github.com/alexanderstephenthompson/claude-hub
仓库路径:skills/web-css
安装命令:
npx skills add https://github.com/alexanderstephenthompson/claude-hub --skill web-css
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alexanderstephenthompson/claude-hub --skill web-css

简介

用于基于关键词检索和筛选相关信息。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

  • 适合快速定位候选结果或梳理任务线索。
  • 可结合具体场景优化搜索策略。web-css 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 通过 GitHub 仓库安装,适用于多种 Agent 宿主。
  • 建议核实维护状态及是否依赖外部服务。

SKILL.md

Web CSS Skill

Version: 1.0 Stack: Vanilla CSS with CSS Variables

Clean, maintainable CSS without preprocessors or utility frameworks. Design tokens via CSS variables.

The Problem

AI-generated CSS drifts. Without memory between sessions, similar components end up with slightly different padding, colors, spacing, and border radii — not by design, but by independence. The drift itself isn't the problem. The problem is that every future edit becomes a partial fix: you change .card's background, but .panel uses #fff, .info-box uses white, and .content-block uses rgb(255,255,255) — same color, different formats, so only one gets updated. These standards centralize values into tokens so one edit propagates everywhere.

Consumption

  • Builders: Read ## Builder Checklist before writing any CSS. Every value must use a token; every file must follow the 5-file architecture.
  • Refactorers: Use ## Enforced Rules to find hardcoded values and structural violations. Read narrative sections for token naming and file organization guidance.
  • Both: Narrative sections are the authoritative standard. Checklist and rules table are compressed views of the same content.

Scope and Boundaries

This skill covers:

  • Design token implementation (CSS variables in:root)
  • Token categories (colors, typography, spacing, borders, shadows, animations, z-index)
  • Dark mode implementation with CSS variables
  • CSS file organization and import order
  • BEM-inspired naming conventions
  • Mobile-first responsive breakpoints
  • Layout patterns (Grid for structure, Flexbox for flow)
  • Component states implementation
  • CSS property ordering
  • CSS anti-patterns

Defers to other skills:

  • design: Design system philosophy, when to use Grid vs Flexbox, premium UI principles
  • web-accessibility: Focus indicator patterns, reduced motion media queries, screen reader utilities

Use this skill when: You need CSS architecture, token implementation, or responsive patterns. Use design when: You need design principles, layout philosophy, or component state requirements. Use web-accessibility when: You need WCAG compliance or accessibility-specific CSS patterns.


Core Principles

  1. Design Tokens First — All values come from CSS variables.
  2. Component-Scoped — CSS lives with its component.
  3. Mobile-First — Base styles for mobile, enhance up.
  4. No Magic Numbers — Every value has a purpose and comes from the system.
  5. Readable Over Clever — Obvious code beats clever code.
  6. Consolidate, Don't Duplicate — Check for existing styles before creating new ones.

Before Writing New CSS

This is a gate, not a suggestion. Every new class that duplicates an existing pattern creates a variant. Every variant means future edits only partially propagate — you fix .card but miss .panel and .info-box because they were written independently with different values for the same intent. That's how CSS becomes a whack-a-mole game. Prevention here saves hours of cleanup later.

Before Writing Any Value

  1. Check global.css first — Does a token already exist for this value? Use it. Never write a raw 16px, #3b82f6, or 8px when a token like var(--space-4), var(--color-primary), or var(--radius-md) exists.
  2. Search for similar styles — Is there already a button, card, or layout pattern that does this? Reuse it.
  3. Check for near-matches — Could an existing class work with minor tweaks or a modifier?
  4. Extract if repeated — If you're writing the same properties a second time, stop and make it one class.
/* BAD — new class that duplicates existing .btn-primary */
.modal-submit-btn {
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  border-radius: var(--radius-md);
}

/* GOOD — reuse existing class, add modifier only for what's truly different */
.modal-footer .btn-primary {
  /* Only add what's actually different */
}

What Creates Drift

PatternWhy It's Dangerous
Raw values instead of tokens16px in one place, 1rem in another — same value, invisible to search-and-replace
New class for existing pattern.action-button when .btn-primary already does the same thing
Copy-paste with tweaksPasting .card styles into .panel and changing one property — now they drift independently
Inconsistent color formats#fff here, white there, rgb(255,255,255) elsewhere — all the same, but a find-replace catches only one

The Rule

If a token exists, use it. If a class exists, extend it. Only create something new when nothing existing fits.


Design Tokens

All design values live in styles/global.css as CSS variables in :root. Token categories:

CategoryExamplesScale
Colors — Semantic--color-primary, --color-errorNamed by purpose
Colors — Neutrals--color-neutral-50 to --color-neutral-90010-step scale
Typography--font-size-xs to --font-size-3xlrem-based
Spacing--space-1 to --space-164px base, 8px scale
Borders--radius-sm to --radius-fullrem-based
Shadows--shadow-sm to --shadow-xlSize scale
Z-index--z-dropdown to --z-toast100-600
Animation--duration-fast to --duration-slowms-based

For full token definitions and values, see assets/token-reference.md.

Dark mode: Override semantic color tokens on [data-theme="dark"]. Components adapt automatically. See assets/token-reference.md for implementation.


File Organization

The 5-File Architecture

All projects use exactly 5 CSS files, loaded in cascade order:

styles/
├── reset.css       # 1. Browser normalization — clean slate
├── global.css      # 2. Design tokens (:root) + element defaults
├── layouts.css     # 3. Page scaffolding, grids, containers
├── components.css  # 4. All component styles (BEM)
└── overrides.css   # 5. Exceptions — one-offs, page-specific, utilities

Enforced by: check.js rules css-file-count (warn >5, error >7) and css-file-names (warn when no canonical names found).

For detailed descriptions of each file (what goes in, what doesn't, internal organization), see references/file-architecture.md.

Templates

Pre-built template files define the canonical section structure for each CSS file. Projects override values, not structure.

templates/
├── reset.css       # Full reset (deterministic, same for every project)
├── global.css      # Token skeleton (:root with 9 categories) + element defaults
├── layouts.css     # Section headers only (project-specific content)
├── components.css  # Pattern template (Base → Variants → States per component)
└── overrides.css   # Section headers + accessibility utilities

Scaffold command: node scaffold-css.js <target-directory> copies all 5 templates. Never overwrites existing files.

Enforced by: check.js rules css-section-order (warn — major sections out of canonical order) and token-category-order (warn — token sub-categories out of order in global.css :root).

Where Does This Go?

Ask yourself...Answer → File
Is it a browser reset with no design opinion?reset.css
Is it a CSS variable or bare-element default?global.css
Does it control where things sit on the page?layouts.css
Is it a reusable UI component with BEM naming?components.css
Is it an exception, one-off, or single-property override?overrides.css
Am I creating a 6th file?Stop. It belongs in one of these 5.

Naming Conventions

BEM-Inspired (Simplified)

.product-card { }          /* Block */
.product-card__image { }   /* Element (child of block) */
.product-card--featured { } /* Modifier (variation) */
.product-card.is-loading { } /* State (JS-toggled) */

Naming Rules

TypeConventionExample
Blockkebab-case.user-profile
Element__element.user-profile__avatar
Modifier--modifier.user-profile--compact
State.is-state.is-active, .is-loading
Utilityu-utility.u-visually-hidden

Responsive Design

  • Mobile-first only: Use min-width breakpoints. Never max-width.
  • Standard breakpoints: 640px (sm), 768px (md), 1024px (lg), 1280px (xl)
  • Grid for structure, Flexbox for flow.
  • All interactive elements need 5 states: default, hover, active, focus-visible, disabled.

For code examples (breakpoints, container pattern, grid/flexbox layouts, component states, accessibility patterns), see assets/css-patterns.md.


Anti-Patterns

Anti-PatternProblemFix
Hardcoded valuesNo consistency, hard to themeUse design tokens
!important everywhereSpecificity warsFix selector specificity
Deep nestingHard to override, specificity issuesMax 3 levels
ID selectors for stylingToo specificUse classes
Styles in JSSplits styling concernsCSS files with component
Global element selectorsAffects everythingScope to component class
max-width media queriesDesktop-first thinkingUse min-width (mobile-first)
Pixel units for font-sizeIgnores user preferencesUse rem
Float for layoutOutdated, fragileUse Grid or Flexbox
Margin for spacing between siblingsAdds up, hard to manageUse gap on parent

Property Order

Organize properties by group. 5 groups, always in this order:

.component {
  /* 1. Positioning */
  position: relative;
  top: 0;
  z-index: var(--z-dropdown);

  /* 2. Box Model */
  display: flex;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: var(--space-4);
  margin: 0;

  /* 3. Typography */
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);

  /* 4. Visual */
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transform: translateY(0);

  /* 5. Animation */
  transition: box-shadow var(--duration-fast);
}

Enforced by: check.js rule css-property-order (warn).


Builder Checklist

Before writing CSS governed by this skill, verify your plan against these constraints. Builders read this section before writing code; refactorers use the Enforced Rules table and full narrative instead.

Design Tokens

  • All colors use CSS variables
  • All spacing uses CSS variables
  • All font sizes use CSS variables
  • All shadows use CSS variables
  • No hardcoded hex colors in component CSS
  • No hardcoded pixel values (except borders)

Organization

  • Tokens defined in central file
  • CSS colocated with components
  • BEM-style naming used
  • No ID selectors for styling

Responsive

  • Mobile-first (min-width queries only)
  • Standard breakpoints used
  • Tested at all breakpoints

Accessibility

  • Focus indicators visible
  • Reduced motion respected
  • Color contrast meets WCAG AA
  • No reliance on color alone

No Tailwind. No PostCSS.

This design system uses vanilla CSS with design tokens. No build tools, no utility-class frameworks, no preprocessors.

Why not Tailwind? It moves styling decisions into HTML, producing class bloat (class="flex items-center gap-4 p-6 rounded-lg bg-white shadow-md") that's hard to scan, hard to search, and impossible to update from one place. Our design system solves the same problem — consistency — by putting it where it belongs: in CSS variables and semantic class names.

Why not PostCSS? Modern CSS supports variables, nesting, @layer, color-mix(), and container queries natively. PostCSS adds a build step and tooling complexity for features browsers already handle.

If a project already uses Tailwind or PostCSS:

  1. Don't add more Tailwind utilities or PostCSS plugins
  2. New CSS goes in vanilla .css files using the 5-file architecture and design tokens
  3. When touching existing Tailwind components, extract the utility chains into semantic classes in components.css that reference tokens
  4. Migrate incrementally — don't rewrite everything at once, but don't extend the old pattern either

Enforced Rules

These rules are deterministically checked by check.js (clean-team). When updating these standards, update the corresponding check.js rules to match — and vice versa.

Rule IDSeverityWhat It Checks
no-hardcoded-colorerrorHex/rgb/hsl/named colors outside var(--color-*)
no-hardcoded-spacingwarnRaw px spacing (>=4px) outside var(--space-*)
no-hardcoded-font-sizewarnFont sizes outside var(--font-size-*)
no-hardcoded-radiuswarnBorder-radius outside var(--radius-*)
no-hardcoded-shadowwarnBox/text-shadow outside var(--shadow-*)
no-hardcoded-z-indexwarnZ-index outside var(--z-*)
css-property-orderwarnProperties not in group order (Position > Box Model > Typography > Visual > Animation)
css-import-orderwarn@import/<link> order doesn't match cascade sequence
css-section-orderwarnMajor section headers out of canonical order within a file
token-category-orderwarnToken sub-categories out of order in global.css :root
mobile-firstwarnmax-width media queries instead of min-width
no-importantwarn!important usage
no-id-selectorwarn#id selectors (specificity wars)
unit-zerowarn0px/0rem instead of unitless 0
css-file-countwarn/errorMore than 5 (warn) or 7 (error) CSS files
css-file-nameswarnNo canonical CSS file names (reset/global/layouts/components/overrides)

References

  • references/file-architecture.md — Detailed descriptions of each CSS file
  • assets/token-reference.md — Full token definitions, usage examples, dark mode
  • assets/css-patterns.md — Responsive, layout, state, and accessibility code examples

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.45%
按下载量换算55

Claude

28.45%
按下载量换算43

Cursor

18.15%
按下载量换算28

Gemini CLI

10.25%
按下载量换算16

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills