Skip to content
cccskills
FreePublished on GitHub

dzero-css

D-ZERO の CSS コーディング規約。CSS を書く・編集する・レビューするときに使う。コンポーネントのスタイル、レイアウト、レスポンシブ、カスタムプロパティ、セレクタ設計に適用する。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md3.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

CSS コーディング規約

実装レイヤー選定(dzero-tech-selection)を経ていない場合は先にそちらを読むこと。詳細は CSS ガイドライン を参照。

実装規範

  • リントエラー(Stylelint / Prettier)は例外なく必ず修正する。stylelint-disable コメントは原則使わず、ルールが現状にそぐわない場合は Config ファイル(.stylelintrc の selector-class-pattern 等)の変更を提案する
  • ブラウザの予期せぬバグで期待どおり動かない場合は、ハックで抑え込まず別のアプローチ(別のプロパティ・実装方法)で解決する

ファイル構成

  • コンポーネントのスタイルは __assets/_libs/component/c-コンポーネント名.css に置く(1 ファイル 1 コンポーネント・ファイル名とクラス名の一致は Stylelint が強制する)
  • __assets/htdocs/css/style.css は @import のみでスタイルを定義しない。インポートは CSS レイヤー(reset / base / general / components / main)で分類する
  • base/root.css のセレクタは :root のみ。グローバルなカスタムプロパティ(Figma のバリアブル由来を含む)はここに定義する
  • general/ は素の要素へのスタイル(ファイル名はタグ名、セレクタはタイプセレクタのみ)。ページ全体に影響するため必要最小限にし、コンポーネントで定義できるものはコンポーネント内で定義する。「サイト全体で共通」という判断はほとんどの場合失敗するので推奨しない

セレクタ

  • タイプセレクタは利用可能だが、コンポーネントはコンポーネントを内包できるため注意する。エレメントにクラスを付けて対象を限定するか、> 結合子で影響範囲を限定する

セレクタの形式(BEM 記法のフラットセレクタ、ID セレクタの禁止、記述順など)は Stylelint が強制するため、警告に従って修正すればよい。

値

  • 値の意図が伝わる書き方をする。font-size はコンポーネントのルートは rem、エレメントは em を推奨(値のフォーマット自体は Stylelint が強制する)
  • 余白・サイズなど、プロジェクトのカスタムプロパティ(デザイントークン)に対応する値を直接書かない。var() で参照する(色・z-index の直書きは Stylelint が警告する) <!-- 暫定ルール: stylelint(declaration-strict-value 系)による色以外のトークン強制を linters に提案中。導入されたらこの項目は削除する -->
  • line-height は絶対値(px)で書かず、font-size との比率で書く <!-- 暫定ルール: stylelint(declaration-property-unit-disallowed-list)による line-height の px 禁止を linters に提案中。導入されたらこの項目は削除する -->

カスタムプロパティ

  • カスタムプロパティは積極的に採用する
  • レスポンシブのブレークポイントは規定のカスタムクエリー(--xs 〜 --xl、--*-lte / --*-gt、--hr)を利用する

命名

クラス名・識別子の命名は dzero-html の「命名」に従う。

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

D-ZERO のアクセシビリティ規約。マークアップやインタラクションの実装・変更・レビューで、WAI-ARIA、代替テキスト(alt)、ランドマーク、見出し、キーボード操作、フォーカスを扱うときに使う。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

デザインデータ(Figma などのデザインカンプ)を参照してコーディングするときの解釈原則とアセットの扱い。Figma の URL・MCP・デザイン画像・カンプをもとに実装や修正をするときに必ず使う。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

D-ZERO の HTML/Pug マークアップ規約。HTML や Pug を書く・編集する・レビューするときに使う。コンポーネント設計、クラス命名、文書構造、画像、リンク、メタ情報に適用する。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

D-ZERO の JavaScript/TypeScript コーディング規約。JS/TS を書く・編集する・レビューするときに使う。イベント処理、DOM 操作、状態変更、ライブラリ追加、スクリプト読み込みに適用する。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

フロントエンド実装のコードレビューを実施する。PR レビュー、コードレビュー、実装チェック、品質確認を依頼されたときに使う。実装レイヤー選定の妥当性から各技術軸の観点まで順に検査する。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

UI・機能・コンポーネントの実装レイヤー(HTML/CSS/JavaScript)を決定する判断基準。実装・修正の着手前に必ず読む。アコーディオン、モーダル、ポップオーバー、開閉・切替などのインタラクション実装を依頼されたときに使う。

The English summary is being prepared. Showing the original description.

d-zero-dev/frontend-guidelines20Updated Oct 15, 2026

See all skills by d-zero-dev

Report a problem with this skill