本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)18k · #10671

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/css-expert/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル