このページの翻訳は LLM によって生成されています。誤りに気づいた場合は GitHub で issue を開いてお知らせください。
CSSトークン
varshaのデザインシステムはCSSカスタムプロパティ(CSS変数)上に構築されています。すべてのカラー、フォント、スペーシング、角丸、シャドウはトークン化されており、一貫したテーマ切り替えと簡単なカスタマイズを可能にします。
カラートークン
Section titled “カラートークン”すべてのテーマは同じセマンティックカラートークンのセットを実装しています:
| トークン | 用途 |
|---|---|
--color-bg | ページの背景色 |
--color-fg | プライマリテキスト/前景色 |
--color-muted | セカンダリテキスト、補足情報 |
--color-accent | プライマリアクセントカラー(リンク、ボタン、強調) |
--color-surface | カード、パネル、入力欄の背景 |
--color-border | 境界線、ディバイダー |
テーマ別カラー例
Section titled “テーマ別カラー例”Tokyo Night(デフォルトダーク):
:root[data-theme="tokyo-night"] { --color-bg: #1a1b26; --color-fg: #c0caf5; --color-muted: #9aa5ce; --color-accent: #7aa2f7; --color-surface: #24283b; --color-border: #414868;}Tokyo Day(デフォルトライト):
:root[data-theme="tokyo-day"] { --color-bg: #f7f7f7; --color-fg: #3760bf; --color-muted: #6172b0; --color-accent: #2e7de9; --color-surface: #ffffff; --color-border: #d9dde8;}タイポグラフィトークン
Section titled “タイポグラフィトークン”フォントファミリー
Section titled “フォントファミリー”--font-sans: 'Inter', system-ui, -apple-system, sans-serif;--font-mono: 'JetBrains Mono', ui-monospace, monospace;--font-display: 'Inter', system-ui, sans-serif;フォントサイズ
Section titled “フォントサイズ”--text-xs: 0.75rem; /* 12px */--text-sm: 0.875rem; /* 14px */--text-base: 1rem; /* 16px */--text-lg: 1.125rem; /* 18px */--text-xl: 1.25rem; /* 20px */--text-2xl: 1.5rem; /* 24px */--text-3xl: 1.875rem; /* 30px */--text-hero: clamp(2.5rem, 5vw, 4rem);--leading-tight: 1.2;--leading-normal: 1.5;--leading-relaxed: 1.65;スペーシングトークン
Section titled “スペーシングトークン”すべてのスペーシングは4pxのベースラインに従います:
--space-1: 0.25rem; /* 4px */--space-2: 0.5rem; /* 8px */--space-3: 0.75rem; /* 12px */--space-4: 1rem; /* 16px */--space-6: 1.5rem; /* 24px */--space-8: 2rem; /* 32px */--space-12: 3rem; /* 48px */--space-16: 4rem; /* 64px */--space-24: 6rem; /* 96px */--section-padding: clamp(3rem, 8vw, 6rem);角丸トークン
Section titled “角丸トークン”--radius-sm: 0.25rem; /* 4px — タグ、バッジ */--radius-md: 0.5rem; /* 8px — ボタン、入力欄 */--radius-lg: 0.75rem; /* 12px — カード */--radius-xl: 1rem; /* 16px — 大きなパネル */--radius-full: 9999px; /* ピル形状 */シャドウトークン
Section titled “シャドウトークン”--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);コンテナとレイアウト
Section titled “コンテナとレイアウト”--container-max: 72rem; /* 1152px */--container-narrow: 48rem; /* 768px — ブログ記事、ドキュメント */トークンのカスタマイズ
Section titled “トークンのカスタマイズ”これらのトークンをオーバーライドするには、src/styles/global.cssの:rootまたは特定のテーマセレクタで新しい値を定義します:
:root { --color-accent: #ff6b6b; /* カスタムアクセントカラー */ --font-sans: 'Poppins', system-ui, sans-serif; --radius-lg: 1rem; /* より丸いカード */}カスタムテーマの作成
Section titled “カスタムテーマの作成”独自のテーマを作成するには、テーマスイッチャーで認識されるように、新しい[data-theme="your-theme"]セレクタを追加します。テーマガイドを参照してください。