css-expert
できること
このスキルは、フレックスボックス、グリッド、カスタムプロパティ、コンテナクエリなど、最新のCSSによるレスポンシブなレイアウトを案内します。Webページを作るフロントエンド開発者やデザイナー向けです。
使う場面
- ✓スマートフォンからデスクトップまで対応するページレイアウトが必要なとき。
- ✓あるセクションにフレックスボックスとグリッドのどちらを使うか選ぶとき。
- ✓色や余白を再利用できるデザイントークンとして管理したいとき。
スキルのリンク
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/css-expert/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“商品カードを、デスクトップでは3列、スマートフォンでは1列に表示するレスポンシブなグリッドにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは、1行または1列にはフレックスボックス、縦横の二次元レイアウトにはグリッドを使うことを勧めます。テーマ設定にはカスタムプロパティを、スマートフォン向けを基本にしたメディアクエリを使います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
CSS Expert
A front-end layout specialist with deep command of modern CSS, from flexbox and grid to container queries and cascade layers. This skill provides precise, standards-compliant guidance for building responsive, accessible, and maintainable user interfaces using the latest CSS specifications and best practices.
Key Principles
- Use flexbox for one-dimensional layouts (rows or columns) and CSS Grid for two-dimensional layouts (rows and columns simultaneously)
- Embrace custom properties (CSS variables) for theming, spacing scales, and any value that repeats or needs runtime adjustment
- Design mobile-first with min-width media queries, layering complexity as viewport size increases
- Prefer logical properties (inline-start, block-end) over physical ones (left, bottom) for internationalization-ready layouts
- Leverage the cascade intentionally with @layer declarations to control specificity without resorting to !important
Techniques
- Use flexbox justify-content and align-items for main-axis and cross-axis alignment; flex-wrap with gap for fluid card layouts
- Define CSS Grid layouts with grid-template-areas for named regions, and auto-fit/auto-fill with minmax() for responsive grids without media queries
- Create design tokens as custom properties on :root (--color-primary, --space-md) and override them in scoped selectors or media queries
- Use @container queries to style components based on their parent container size rather than the viewport
- Build animations with @keyframes and animation shorthand; prefer transform and opacity for GPU-accelerated, jank-free motion
- Apply transitions on interactive states (hover, focus-visible) with appropriate duration (150-300ms) and easing functions
- Use the :has() selector for parent-aware styling, :is()/:where() for grouping selectors with controlled specificity
Common Patterns
- Holy Grail Layout: CSS Grid with grid-template-rows (auto 1fr auto) and grid-template-columns (sidebar content sidebar) for header/footer/sidebar page structures
- Fluid Typography: clamp(1rem, 2.5vw, 2rem) for font sizes that scale smoothly between minimum and maximum values without breakpoints
- Aspect Ratio Boxes: Use the aspect-ratio property directly instead of the legacy padding-bottom hack for responsive media containers
- Dark Mode Toggle: Define color tokens as custom properties, swap them inside a prefers-color-scheme media query or a data-theme attribute selector
Pitfalls to Avoid
- Do not use fixed pixel widths for layout containers; prefer percentage, fr units, or min/max constraints for fluid responsiveness
- Do not stack z-index values arbitrarily; establish a z-index scale in custom properties and document each layer's purpose
- Do not rely on vendor prefixes without checking current browser support; tools like autoprefixer handle this systematically
- Do not nest selectors excessively in preprocessors, as the generated CSS becomes highly specific and difficult to maintain or override
よくある質問
いつフレックスボックスではなくグリッドを使うべきですか?
行と列を同時に扱うレイアウトにはグリッドを、1列に並ぶ項目にはフレックスボックスを使います。
デザイントークンとは何ですか?
主要な色や余白の大きさなどに付ける名前付きの値です。CSSのカスタムプロパティとして保存し、ページ全体で再利用します。
!importantを使わずに上書きできますか?
はい。このスキルは、!importantを使う代わりに、カスケードレイヤーで優先順位を管理することを勧めています。
詳細
作者による元の説明
CSS expert for flexbox, grid, animations, responsive design, and modern layout techniques
repo: RightNow-AI/openfang
人気
- GitHubのスター
- 18k
- ランキング
- #10671
- ライセンス
- Apache-2.0
- 更新日
- 2026/7/2
コメント
- …
このリポジトリの他のスキル
browser-automation
18kエージェントが、Playwrightを使ってWebブラウザーを操作するよう教えます。CSSセレクターでボタン、フォーム、リンクを見つけます。
clip-hand-skill
18kエージェントが、動画のクリップを作るのを助けます。動画をダウンロードし、音声を文字起こしし、字幕ファイルを作り、ffmpegでクリップを切り出します。
collector-hand-skill
18kエージェントが、トピックや企業に関する公開情報を集め、主要な実体を抽出し、変化を追い、感情を測るのを助けます。
infisical-sync-skill
18kエージェントが、APIを通じてInfisicalの保管庫の秘密情報を読み、更新するのを助けます。ログインの手順と明確なエラー処理を含みます。
似ているスキル
angular-developer
280kエージェントがAngularのコードを作成し、プロジェクト構成についてアドバイスできるようにします。新しいプロジェクトの開始、コード部品の作成、パフォーマンスやアクセシビリティの改善に役立ちます。
frontend-a11y
280kエージェントが Web インターフェースを誰にとっても使いやすくするよう支援します。スクリーンリーダーやキーボード操作に対応し、サイトやアプリが適切に動作するようにします。
frontend-patterns
280kエージェントがフロントエンド開発の最新パターンを適用できるようにします。React と Next.js において、パフォーマンスの最適化、状態管理、ベストプラクティスの遵守を行います。