デザインシステム基盤
デジタル庁デザインシステム(DADS)のFoundationsを参考に設計された、本プロジェクトのカラー、タイポグラフィ、およびコーディング規則のリファレンスです。
カラーパレット (Semantic Colors)
セマンティック(意味・役割)に基づいて定義されたCSS変数群です。テーマセレクターを切り替えると各色見本の色も連動して変化します。
--color-surface主要な背景色。カードやコンテンツセクション用。
--color-surface-subtle控えめな背景色。ヘッダーやフッター、コード領域用。
--color-border境界線や分割線用のカラー。
--color-text-defaultメインとなる標準テキスト用カラー。高いコントラスト。
--color-text-mutedサブテキスト、説明文などの控えめな文字用カラー。
--color-text-on-actionアクションボタン等の背景上のテキスト用。
--color-action-primaryプライマリボタンやブランドアクセント色。
--color-action-secondaryセカンダリの補助的なボタン用。
--color-action-danger削除などの注意を促すアクション用。
タイポグラフィ (Typography)
サイト内で定義されているフォントサイズスケール。Tailwind v4 の `@theme` 定義から、以下のユーティリティクラスが利用可能です。
text-display(2.5rem (40px))text-heading(1.5rem (24px))text-body(1.0rem (16px))text-caption(0.75rem (12px))レイアウト・角丸設計規約 (Spacing & Corner Radius)
デザインシステムを一貫させつつ、コードの肥大化を防ぐため、**余白(間隔)や角丸の指定は独自の変数化をせず、Tailwind CSS v4の標準ユーティリティクラスに完全に依存します。**
- 余白 (Margin / Padding): 主に `p-4`, `p-6`, `p-8` / `gap-4`, `gap-6` 等を使用し、要素同士の規則的なジャンプ(4の倍数ピクセル)を徹底します。
- 角丸 (Border Radius): カード類は `rounded-xl`、バッジ等は `rounded-full` を適用して、プロダクトに一貫したソフトな印象を与えます。
アクセシビリティ・アイコン規約 (Accessibility & Icons)
デジタル庁(DADS)のアクセシビリティ設計方針にならい、情報がすべての人に正しく伝わるよう実装します。
- アイコン用SVGマークアップ: 装飾目的のアイコンには `aria-hidden="true"` を必ず付与します。
- 代替テキストの提供: 文字を含まないアイコンのみのボタン(例: `RoundButton`)では、必ず適切な `aria-label` を渡して何をおこなうボタンかをスクリーンリーダーに明示します。
- コントラスト比: すべての背景色とテキスト色の組み合わせは、WCAG 2.1 レベルAA(コントラスト比4.5:1以上)を保証します。
共通コンポーネント
ポートフォリオサイト全体で使用されている再利用可能な UI パーツ群です。 CVA (Class Variance Authority) と Tailwind v4 を活用し、高い拡張性と型安全性を実現しています。
SimpleButton
基本となる長方形のボタンコンポーネント。インテント(種類)とサイズを指定可能です。
<SimpleButton.Primary>Primary Button</SimpleButton.Primary><SimpleButton.Secondary>Secondary Button</SimpleButton.Secondary><SimpleButton.Danger>Danger Button</SimpleButton.Danger><SimpleButton.Primary size="sm">Small Button</SimpleButton.Primary><SimpleButton.Primary loading>Loading</SimpleButton.Primary><SimpleButton.Primary disabled>Disabled Button</SimpleButton.Primary>RoundButton
アイコン表示に最適な、円形のボタンコンポーネント。
<RoundButton.Primary aria-label="Add item">
<svg className="w-5 h-5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
</RoundButton.Primary><RoundButton.Secondary aria-label="Settings">
<svg className="w-5 h-5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
</svg>
</RoundButton.Secondary><RoundButton.Danger aria-label="Delete">
<svg className="w-5 h-5" fill="none" stroke="currentColor" strokeWidth="2" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
</RoundButton.Danger>Badge
ステータスやタグ情報を示すバッジコンポーネント。インテントに応じた配色バリエーションを持ちます。
<Badge variant="primary">Active</Badge><Badge variant="secondary">Draft</Badge><Badge variant="danger">Error</Badge><Badge variant="outline">Secondary Info</Badge>Card
コンテンツを囲むパネルコンポーネント。枠線の有無やホバーエフェクトの選択が可能です。
Default Card Title
ホバー時に影が強調される標準的なカードレイアウトです。
<Card>
<h4 className="text-body font-bold text-text-default mb-2">Default Card Title</h4>
<p className="text-caption text-text-muted">ホバー時に影が強調される標準的なカードレイアウトです。</p>
</Card>Subtle Card Title
枠線がなく、控えめな背景色のみのカードスタイルです。
<Card variant="subtle">
<h4 className="text-body font-bold text-text-default mb-2">Subtle Card Title</h4>
<p className="text-caption text-text-muted">枠線がなく、控えめな背景色のみのカードスタイルです。</p>
</Card>