web-css
CSS: Grid/Flexbox, custom properties, animations, media queries, BEM, CSS Modules, :has/:is
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o web-css.zip https://jpskill.com/download/22296.zip && unzip -o web-css.zip && rm web-css.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22296.zip -OutFile "$d\web-css.zip"; Expand-Archive "$d\web-css.zip" -DestinationPath $d -Force; ri "$d\web-css.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
web-css.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
web-cssフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
web-css
目的
このスキルは、OpenClaw が CSS コードを生成、最適化、デバッグすることを可能にします。Grid や Flexbox レイアウト、カスタムプロパティ(変数)、アニメーション、メディアクエリ、BEM メソドロジー、CSS Modules、そして :has() や :is() のようなセレクターといった高度な機能に焦点を当てています。
使用場面
このスキルは、React や Vue のようなフレームワークを使用するプロジェクトで、レスポンシブなレイアウトの作成、要素のアニメーション化、スタイルのモジュール化など、コンポーネントのスタイリングを伴うウェブ開発タスクに使用します。コードが効率的で、保守しやすく、モダンなブラウザと互換性がある必要がある場合に適用してください。
主な機能
- Grid/Flexbox: CSS Grid(例:
display: grid; grid-template-columns: repeat(3, 1fr);)または Flexbox(例:display: flex; justify-content: space-between;)を使用してレイアウトを作成します。 - カスタムプロパティ:
--primary-color: #007bff;のような変数を定義し、テーマ設定に使用します。 - アニメーション: キーフレームアニメーションを実装します。例:
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }。 - メディアクエリ: レスポンシブ対応を処理します。例:
@media (max-width: 768px) { .container { flex-direction: column; } }。 - BEM:
.block__element--modifierのような命名規則を強制し、スケーラブルな CSS を実現します。 - CSS Modules: スコープ付きスタイルを生成します。例:
import styles from './styles.module.css';としてインポートし、className={styles.button}を使用します。 - セレクター: :has() および :is() を利用します。例:
div:has(p) { margin: 10px; }またはbutton:is(:hover, :active) { background: red; }。
使用パターン
OpenClaw でこのスキルを呼び出すには、CLI コマンド openclaw execute web-css --input "task description" --options key=value を使用します。API 連携の場合、/api/skills/web-css に { "task": "generate grid layout", "params": { "elements": 3 } } のような JSON ボディで POST リクエストを送信します。認証のために環境変数 $OPENCLAW_API_KEY を常に設定してください。入力は文字列または JSON オブジェクトとして渡します。例えば、--feature grid や --feature animations のようなフラグを介して CSS 機能を指定します。
一般的なコマンド/API
- レイアウトの生成:
openclaw execute web-css --task generate --type flexbox --properties "justify-content:center; align-items:center;"を実行して Flexbox スニペットを出力します。 - アニメーションの追加: API エンドポイント: POST /api/skills/web-css にボディ
{ "action": "add-animation", "selector": ".fade-element", "keyframes": "from { opacity: 0; }" }を使用してアニメーションコードを追加します。 - メディアクエリの最適化: コマンド:
openclaw execute web-css --optimize --breakpoints "mobile:480px, tablet:768px"を使用してレスポンシブスタイルを洗練します。 - 設定形式: 設定は JSON で提供します。例:
{ "bem": true, "modules": { "path": "./src/styles" } }。CSS Modules の場合、出力にimport styles from './Component.module.css';のようなインポートステートメントが含まれることを確認してください。 - コードスニペットの例:
.container { display: flex; flex-wrap: wrap; }これは
openclaw execute web-css --task layout --type flexboxを介して生成されます。
連携に関する注意点
このスキルを Webpack や Vite のようなビルドツールと連携させるには、出力をモジュール形式でラップします。例えば、OpenClaw の出力を CSS プロセッサにパイプします: openclaw execute web-css --output file.css && postcss file.css --use autoprefixer。Node.js 環境で使用する場合、const openclaw = require('openclaw-sdk'); openclaw.run('web-css', { auth: process.env.OPENCLAW_API_KEY }); としてインポートします。CSS の出力がフレームワークと互換性があることを確認してください。React の場合、BEM パターンに一致するクラス名を生成します。モジュール用の css-loader のようなライブラリを含めることで依存関係を処理します。
エラー処理
一般的なエラーには、無効な CSS 構文や API キーの欠落があります。応答で "SyntaxError" を確認し、修正された入力で再試行してください。認証が失敗した場合は、$OPENCLAW_API_KEY が設定されており、期限切れでないことを確認してください。API 呼び出しの場合、401 (unauthorized) のような HTTP エラーをログに記録し、再認証を促すことで捕捉します。例: コードでは、try-catch を使用します。
try {
const response = await fetch('/api/skills/web-css', { headers: { 'Authorization': `Bearer ${process.env.OPENCLAW_API_KEY}` } });
if (!response.ok) throw new Error('API error');
} catch (error) {
console.error('Handle:', error.message); // Output: "API error"
}
実行前に常に、セレクターが有効な文字列であることなど、入力を検証してください。
具体的な使用例
-
Flexbox レイアウトの生成: レスポンシブなナビゲーションバーを作成するには、
openclaw execute web-css --task generate-layout --type flexbox --selectors ".nav" --properties "justify-content:space-around;"を実行します。これにより、以下が出力されます。.nav { display: flex; justify-content: space-around; }次に、これを
<nav class="nav">...</nav>として HTML に統合します。 -
レスポンシブ対応のためのメディアクエリ: グリッドベースのギャラリーの場合、
openclaw execute web-css --task add-media --breakpoint "768px" --selector ".gallery" --styles "grid-template-columns:1fr;"を使用します。結果のスニペットは次のとおりです。@media (min-width: 768px) { .gallery { grid-template-columns: repeat(2, 1fr); } }このコードをプロジェクトに適用して、ギャラリーをタブレット画面に適応させます。
グラフの関係
- 関連: web-html (構造のために依存)、web-js (動的スタイリングのために統合)、tools-build (CSS Modules の処理のために使用)。
- クラスター: 共有のウェブタスクのために web-dev クラスターを介して接続されています。
- タグ: クロススキルクエリのために "css" および "web" と重複します。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
web-css
Purpose
This skill allows OpenClaw to generate, optimize, and debug CSS code focusing on advanced features like Grid and Flexbox layouts, custom properties (variables), animations, media queries, BEM methodology, CSS Modules, and selectors like :has() and :is().
When to Use
Use this skill for web development tasks involving styling components, such as creating responsive layouts, animating elements, or modularizing styles in projects using frameworks like React or Vue. Apply it when code needs to be efficient, maintainable, and compatible with modern browsers.
Key Capabilities
- Grid/Flexbox: Create layouts using CSS Grid (e.g.,
display: grid; grid-template-columns: repeat(3, 1fr);) or Flexbox (e.g.,display: flex; justify-content: space-between;). - Custom Properties: Define and use variables like
--primary-color: #007bff;for theming. - Animations: Implement keyframe animations, e.g.,
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }. - Media Queries: Handle responsiveness, e.g.,
@media (max-width: 768px) { .container { flex-direction: column; } }. - BEM: Enforce naming conventions like
.block__element--modifierfor scalable CSS. - CSS Modules: Generate scoped styles, e.g., importing as
import styles from './styles.module.css';and usingclassName={styles.button}. - Selectors: Utilize :has() and :is(), e.g.,
div:has(p) { margin: 10px; }orbutton:is(:hover, :active) { background: red; }.
Usage Patterns
To invoke this skill in OpenClaw, use the CLI command: openclaw execute web-css --input "task description" --options key=value. For API integration, send a POST request to /api/skills/web-css with a JSON body like { "task": "generate grid layout", "params": { "elements": 3 } }. Always set the environment variable for authentication: $OPENCLAW_API_KEY. Pass inputs as strings or JSON objects; for example, specify CSS features via flags like --feature grid or --feature animations.
Common Commands/API
- Generate Layout: Run
openclaw execute web-css --task generate --type flexbox --properties "justify-content:center; align-items:center;"to output a Flexbox snippet. - Add Animation: Use API endpoint: POST /api/skills/web-css with body
{ "action": "add-animation", "selector": ".fade-element", "keyframes": "from { opacity: 0; }" }to append animation code. - Optimize Media Queries: Command:
openclaw execute web-css --optimize --breakpoints "mobile:480px, tablet:768px"to refine responsive styles. - Config Format: Provide configurations in JSON, e.g.,
{ "bem": true, "modules": { "path": "./src/styles" } }. For CSS Modules, ensure output includes import statements likeimport styles from './Component.module.css';. - Code Snippet Example:
.container { display: flex; flex-wrap: wrap; }Generated via
openclaw execute web-css --task layout --type flexbox.
Integration Notes
Integrate this skill with build tools like Webpack or Vite by wrapping outputs in module formats. For example, pipe OpenClaw output to a CSS processor: openclaw execute web-css --output file.css && postcss file.css --use autoprefixer. If using in a Node.js environment, import as const openclaw = require('openclaw-sdk'); openclaw.run('web-css', { auth: process.env.OPENCLAW_API_KEY });. Ensure CSS outputs are compatible with your framework; for React, generate class names that match BEM patterns. Handle dependencies by including libraries like css-loader for modules.
Error Handling
Common errors include invalid CSS syntax or missing API keys; check for "SyntaxError" in responses and retry with corrected input. If authentication fails, verify $OPENCLAW_API_KEY is set and not expired. For API calls, catch HTTP errors like 401 (unauthorized) by logging and prompting for re-auth. Example: In code, use try-catch:
try {
const response = await fetch('/api/skills/web-css', { headers: { 'Authorization': `Bearer ${process.env.OPENCLAW_API_KEY}` } });
if (!response.ok) throw new Error('API error');
} catch (error) {
console.error('Handle:', error.message); // Output: "API error"
}
Always validate inputs before execution, e.g., ensure selectors are valid strings.
Concrete Usage Examples
-
Flexbox Layout Generation: To create a responsive navigation bar, run
openclaw execute web-css --task generate-layout --type flexbox --selectors ".nav" --properties "justify-content:space-around;". This outputs:.nav { display: flex; justify-content: space-around; }Then, integrate it into your HTML as
<nav class="nav">...</nav>. -
Media Query for Responsiveness: For a grid-based gallery, use
openclaw execute web-css --task add-media --breakpoint "768px" --selector ".gallery" --styles "grid-template-columns:1fr;". Resulting snippet:@media (min-width: 768px) { .gallery { grid-template-columns: repeat(2, 1fr); } }Apply this in a project to make the gallery adapt to tablet screens.
Graph Relationships
- Related to: web-html (depends on for structure), web-js (integrates for dynamic styling), tools-build (uses for processing CSS Modules).
- Clusters: Connected via web-dev cluster for shared web tasks.
- Tags: Overlaps with "css" and "web" for cross-skill queries.