トークン
実サービスへ通信しない見本です。モデルの描画は静止した代替表示です。
元 commit: d204666f04a0ee7b6f18543f8aec414b4128874e · shadcn build 4.23.1
Noto Sans JP · @fontsource/noto-sans-jp 5.3.1 · OFL-1.1
操作を試す
取り込む(公開予定)
以下の URL は公開予定です。公開前は取り込めません。既存ファイルとの差分を確認してから実行し、--overwrite を既定にしないでください。
npx shadcn@latest add https://spritestack.dev/r/spst-theme.jsoncomponents.json の registries に追加
{"registries":{"@spritestack":"https://spritestack.dev/r/{name}.json"}}npx shadcn@latest add @spritestack/spst-themeReact 19・Tailwind v4・shadcn の src/ を持つ構成が対象です。src/ の無い構成は未検証です。取り込みはソースのコピーで、自動更新されません。
import "./styles/spritestack/theme.css";
<div className="spst-theme" data-theme="light">
{/* Render components here. */}
</div>Portal の container / portalContainer は .spst-theme 内の要素を渡してください。Noto Sans JP の 400・600・700 は利用先が自己ホストしてください。未導入時は system-ui です。
依存
外部依存なし
Props / API
以下は実際のソースを構文解析して生成しています。… の行は継承する React / Radix の公開型です。既定欄の — は、この関数の引数で既定を指定していないことを表します。union の必須条件は型宣言も確認してください。
CSS の変数を提供します。React の props とイベントはありません。
アクセシビリティの利用条件
- 入力には Label または読み上げ名を与え、エラーを aria-describedby で関連づけます。色だけで状態を伝えません。
- 画像にはモデル名と代替表示を与えます。単独アイコンのボタンにも名前が必要です。
- Dialog / Sheet に題名と説明を与え、Portal をテーマ内に置きます。Tab・矢印・Escape と閉じた後のフォーカスを利用先でも確認します。
- Slider は名前と有限の min < max、ToggleGroup は空でない single の値が必要です。pending は親が制御します。
対応画像: 01–11 · 暗色とエラーは設計による補完です。
測った値と採用した値
採取値と座標は承認済み設計 §3.3、採用値は tokens.css から毎回読みます。
| Token | 画像・座標 | 採取値 | 明 | 暗 |
|---|---|---|---|---|
--spst-background | 01: 600,70,650,90 | #f0f6fe | #f0f6fe | #151e30 |
--spst-card | 01: 1100,650,1150,675 | #fafbfe | #fafbfe | #1a263c |
--spst-foreground | 01: 58,110,510,140 | #1a263c | #1a263c | #f0f6fe |
--spst-muted-foreground | 04: 1000,321,1435,341 | #384b67 | #384b67 | #bbc2ce |
--spst-primary | 01: 1100,765,1150,785 | #255ab1 | #255ab1 | #b3c5e4 |
--spst-primary-foreground | 01: 1225,766,1360,785 | #ffffff | #ffffff | #1a263c |
--spst-border | 01: 1063,200,1064,400 | #d2dcea | #d2dcea | #384b67 |
--spst-input | 07: 241,305,242,322 | #9cacca | #6d7c97 | #9aa3b0 |
--spst-ring | 01: 29,290,31,450 | #1c4db0 | #1c4db0 | #b0c1e3 |
--spst-selected | 10: 140,280,460,300 | #ccdffd | #ccdffd | #384b67 |
--spst-attention-foreground | 06: 460,498,540,520 | #080b28 | #080b28 | #ccdffd |
--spst-attention | 10: 140,280,460,300 | #ccdffd | #ccdffd | #080b28 |
--spst-success | 07: 370,506,378,520 | #d6f2dd | #d6f2dd | #093115 |
--spst-success-foreground | 07: 382,505,455,526 | #093115 | #093115 | #d6f2dd |
--spst-stage | 03: 90,200,160,260 | #f2f7fd | #f2f7fd | #1a263c |
--spst-grid | 03: 205,380,260,420 | #c4d3ef | #c4d3ef | #384b67 |
--spst-radius-card | 設計 §3.6 の近似・設計値 | — | 14px | 14px |
--spst-radius-button | 設計 §3.6 の近似・設計値 | — | 12px | 12px |
--spst-radius-input | 設計 §3.6 の近似・設計値 | — | 12px | 12px |
--spst-radius-badge | 設計 §3.6 の近似・設計値 | — | 999px | 999px |
--spst-shadow-card | 設計 §3.6 の近似・設計値 | — | 0 1px 3px rgb(26 38 60 / 0.06) | 0 1px 3px rgb(26 38 60 / 0.06) |
--spst-shadow-popover | 設計 §3.6 の近似・設計値 | — | 0 4px 12px rgb(26 38 60 / 0.12) | 0 4px 12px rgb(26 38 60 / 0.12) |
--spst-overlay | 設計 §3.6 の近似・設計値 | — | rgb(26 38 60 / 0.4) | rgb(26 38 60 / 0.4) |
--spst-font-sans | 設計 §3.6 の近似・設計値 | — | "Noto Sans JP", system-ui, sans-serif | "Noto Sans JP", system-ui, sans-serif |
--spst-font-mono | 設計 §3.6 の近似・設計値 | — | ui-monospace, SFMono-Regular, Menlo, Consolas, monospace | ui-monospace, SFMono-Regular, Menlo, Consolas, monospace |
--spst-text-sm | 設計 §3.6 の近似・設計値 | — | 0.875rem | 0.875rem |
--spst-text-sm-line-height | 設計 §3.6 の近似・設計値 | — | 1.5 | 1.5 |
--spst-text-base | 設計 §3.6 の近似・設計値 | — | 1rem | 1rem |
--spst-text-base-line-height | 設計 §3.6 の近似・設計値 | — | 1.7 | 1.7 |
--spst-text-lg | 設計 §3.6 の近似・設計値 | — | 1.25rem | 1.25rem |
--spst-text-lg-line-height | 設計 §3.6 の近似・設計値 | — | 1.5 | 1.5 |
--spst-text-xl | 設計 §3.6 の近似・設計値 | — | 1.75rem | 1.75rem |
--spst-text-xl-line-height | 設計 §3.6 の近似・設計値 | — | 1.4 | 1.4 |
--spst-text-display | 設計 §3.6 の近似・設計値 | — | 2.25rem | 2.25rem |
--spst-text-display-line-height | 設計 §3.6 の近似・設計値 | — | 1.25 | 1.25 |
--spst-text-display-narrow | 設計 §3.6 の近似・設計値 | — | 1.75rem | 1.75rem |
--spst-font-weight-body | 設計 §3.6 の近似・設計値 | — | 400 | 400 |
--spst-font-weight-control | 設計 §3.6 の近似・設計値 | — | 600 | 600 |
--spst-font-weight-heading | 設計 §3.6 の近似・設計値 | — | 700 | 700 |
--spst-focus-width | 設計 §3.6 の近似・設計値 | — | 2px | 2px |
--spst-focus-offset | 設計 §3.6 の近似・設計値 | — | 2px | 2px |
--spst-space-1 | 設計 §3.6 の近似・設計値 | — | 0.25rem | 0.25rem |
--spst-space-2 | 設計 §3.6 の近似・設計値 | — | 0.5rem | 0.5rem |
--spst-space-3 | 設計 §3.6 の近似・設計値 | — | 0.75rem | 0.75rem |
--spst-space-4 | 設計 §3.6 の近似・設計値 | — | 1rem | 1rem |
--spst-space-5 | 設計 §3.6 の近似・設計値 | — | 1.5rem | 1.5rem |
--spst-space-6 | 設計 §3.6 の近似・設計値 | — | 2rem | 2rem |
--spst-space-7 | 設計 §3.6 の近似・設計値 | — | 3rem | 3rem |
--spst-space-8 | 設計 §3.6 の近似・設計値 | — | 4rem | 4rem |
コントラスト比
| 前景 / 背景 | 明 | 暗 | 基準 |
|---|---|---|---|
| foreground / background | 13.93:1 | 15.33:1 | 4.5:1 |
| foreground / card | 14.64:1 | 13.93:1 | 4.5:1 |
| foreground / selected | 11.21:1 | 8.15:1 | 4.5:1 |
| foreground / stage | 14.06:1 | 13.93:1 | 4.5:1 |
| muted-foreground / background | 8.15:1 | 9.30:1 | 4.5:1 |
| muted-foreground / card | 8.56:1 | 8.45:1 | 4.5:1 |
| muted-foreground / selected | 6.56:1 | 4.94:1 | 4.5:1 |
| primary / background | 6.08:1 | 9.54:1 | 4.5:1 |
| primary / card | 6.39:1 | 8.67:1 | 4.5:1 |
| primary / selected | 4.89:1 | 5.07:1 | 4.5:1 |
| primary-foreground / primary | 6.61:1 | 8.67:1 | 4.5:1 |
| attention-foreground / attention | 14.27:1 | 14.27:1 | 4.5:1 |
| success-foreground / success | 12.04:1 | 12.04:1 | 4.5:1 |
| input / background | 3.88:1 | 6.54:1 | 3:1 |
| input / card | 4.08:1 | 5.94:1 | 3:1 |
| input / selected | 3.12:1 | 3.48:1 | 3:1 |
| ring / background | 7.06:1 | 9.19:1 | 3:1 |
| ring / card | 7.41:1 | 8.35:1 | 3:1 |
| ring / selected | 5.68:1 | 4.89:1 | 3:1 |
| primary / background | 6.08:1 | 9.54:1 | 3:1 |
| primary / card | 6.39:1 | 8.67:1 | 3:1 |
暗い表示の作り方
暗い画像の測定値ではありません。明の地と文字の役割を交換し、主色とフォーカスは白へ65%、地は明の文字を黒へ20%、控えめな文字は明の地を文字へ25%、入力境界は40%混ぜた設計値です。sRGB の各成分を線形補間して整数へ丸めます。角・余白・影・文字サイズは共通です。