Skip to content

Instantly share code, notes, and snippets.

@yuheiy
Created December 8, 2025 19:47
Show Gist options
  • Select an option

  • Save yuheiy/39e317881685bb0eca32d5213ba83758 to your computer and use it in GitHub Desktop.

Select an option

Save yuheiy/39e317881685bb0eca32d5213ba83758 to your computer and use it in GitHub Desktop.

Tailwind CSS テーマ変数の順序ガイド

ソート原則

  1. 機能的グループ化: 関連する変数を論理的にグループ化
  2. property-order.tsとの整合性: CSSプロパティの出力順序と一致
  3. サイズ順: 同じカテゴリ内では小→大の順序(xs → sm → md → lg → xl)
  4. 色相順: カラーパレットは赤→紫のスペクトル順
  5. デフォルト値は最後: --default-*変数は最後に配置

完全な変数順序リファレンス

@theme {
  /* ========================================
     1. フォントファミリー
     ======================================== */
  --font-sans: ui-sans-serif, system-ui, sans-serif;
  --font-serif: ui-serif, Georgia, Cambria;
  --font-mono: ui-monospace, SFMono-Regular, Menlo;
  --font-{custom}: ...;
  --font-{custom}--font-feature-settings: ...;
  --font-{custom}--font-variation-settings: ...;

  /* ========================================
     2. カラーパレット
     ======================================== */
  /* 主要カラー(色相順) */
  --color-red-50: ...;
  --color-red-100: ...;
  /* ... 900まで */

  --color-orange-50: ...;
  --color-amber-50: ...;
  --color-yellow-50: ...;
  --color-lime-50: ...;
  --color-green-50: ...;
  --color-emerald-50: ...;
  --color-teal-50: ...;
  --color-cyan-50: ...;
  --color-sky-50: ...;
  --color-blue-50: ...;
  --color-indigo-50: ...;
  --color-violet-50: ...;
  --color-purple-50: ...;
  --color-fuchsia-50: ...;
  --color-pink-50: ...;
  --color-rose-50: ...;

  /* ニュートラルカラー */
  --color-slate-50: ...;
  --color-gray-50: ...;
  --color-zinc-50: ...;
  --color-neutral-50: ...;
  --color-stone-50: ...;

  /* 基本カラー */
  --color-black: #000;
  --color-white: #fff;

  /* 特定用途カラー */
  --background-color-*: ...;
  --text-color-*: ...;
  --border-color-*: ...;
  --divide-color-*: ...;
  --ring-color-*: ...;
  --ring-offset-color-*: ...;
  --accent-color-*: ...;
  --caret-color-*: ...;
  --fill-*: ...;
  --stroke-*: ...;
  --text-decoration-color-*: ...;
  --outline-color-*: ...;
  --box-shadow-color-*: ...;
  --drop-shadow-color-*: ...;
  --text-shadow-color-*: ...;

  /* ========================================
     3. スペーシング
     ======================================== */
  --spacing: 0.25rem;
  --margin-*: ...;
  --padding-*: ...;
  --inset-*: ...;
  --space-*: ...;
  --gap-*: ...;
  --scroll-margin-*: ...;
  --scroll-padding-*: ...;
  --border-spacing-*: ...;

  /* ========================================
     4. サイズ関連
     ======================================== */
  --width-*: ...;
  --min-width-*: ...;
  --max-width-*: ...;
  --height-*: ...;
  --min-height-*: ...;
  --max-height-*: ...;
  --size-*: ...;

  /* ========================================
     5. ブレークポイント
     ======================================== */
  --breakpoint-sm: 40rem;
  --breakpoint-md: 48rem;
  --breakpoint-lg: 64rem;
  --breakpoint-xl: 80rem;
  --breakpoint-2xl: 96rem;

  /* ========================================
     6. コンテナサイズ
     ======================================== */
  --container-3xs: 16rem;
  --container-2xs: 18rem;
  --container-xs: 20rem;
  --container-sm: 24rem;
  --container-md: 28rem;
  --container-lg: 32rem;
  --container-xl: 36rem;
  --container-2xl: 42rem;
  --container-3xl: 48rem;
  --container-4xl: 56rem;
  --container-5xl: 64rem;
  --container-6xl: 72rem;
  --container-7xl: 80rem;

  /* ========================================
     7. レイアウト関連
     ======================================== */
  --z-index-*: ...;
  --order-*: ...;
  --grid-column-*: ...;
  --grid-column-start-*: ...;
  --grid-column-end-*: ...;
  --grid-row-*: ...;
  --grid-row-start-*: ...;
  --grid-row-end-*: ...;
  --grid-auto-columns-*: ...;
  --grid-auto-rows-*: ...;
  --grid-template-columns-*: ...;
  --grid-template-rows-*: ...;
  --columns-*: ...;
  --flex-basis-*: ...;
  --aspect-*: ...;
  --line-clamp-*: ...;

  /* ========================================
     8. タイポグラフィ
     ======================================== */
  /* テキストサイズ */
  --text-xs: 0.75rem;
  --text-xs--line-height: 1rem;
  --text-sm: 0.875rem;
  --text-sm--line-height: 1.25rem;
  --text-base: 1rem;
  --text-base--line-height: 1.5rem;
  --text-lg: 1.125rem;
  --text-lg--line-height: 1.75rem;
  --text-xl: 1.25rem;
  --text-xl--line-height: 1.75rem;
  --text-2xl: 1.5rem;
  --text-2xl--line-height: 2rem;
  --text-3xl: 1.875rem;
  --text-3xl--line-height: 2.25rem;
  --text-4xl: 2.25rem;
  --text-4xl--line-height: 2.5rem;
  --text-5xl: 3rem;
  --text-5xl--line-height: 1;
  --text-6xl: 3.75rem;
  --text-6xl--line-height: 1;
  --text-7xl: 4.5rem;
  --text-7xl--line-height: 1;
  --text-8xl: 6rem;
  --text-8xl--line-height: 1;
  --text-9xl: 8rem;
  --text-9xl--line-height: 1;
  --text-{size}--letter-spacing: ...;
  --text-{size}--font-weight: ...;

  /* フォントウェイト */
  --font-weight-thin: 100;
  --font-weight-extralight: 200;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;

  /* レタースペーシング */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ラインハイト */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  --leading-*: ...;

  /* その他テキスト */
  --text-indent-*: ...;
  --text-decoration-thickness-*: ...;
  --text-underline-offset-*: ...;

  /* ========================================
     9. ボーダー
     ======================================== */
  --radius-xs: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-4xl: 2rem;
  --radius: 0.25rem;

  --border-width-*: ...;
  --divide-width-*: ...;
  --outline-width-*: ...;
  --outline-offset-*: ...;
  --ring-width-*: ...;
  --ring-offset-width-*: ...;
  --stroke-width-*: ...;

  /* ========================================
     10. シャドウ
     ======================================== */
  --shadow-2xs: 0 1px rgba(0, 0, 0, 0.05);
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);

  --inset-shadow-*: ...;
  --drop-shadow-*: ...;
  --text-shadow-*: ...;

  /* ========================================
     11. トランスフォーム
     ======================================== */
  --transform-origin-*: ...;
  --perspective-*: ...;
  --perspective-origin-*: ...;
  --translate-*: ...;
  --scale-*: ...;
  --rotate-*: ...;
  --skew-*: ...;

  /* ========================================
     12. エフェクト
     ======================================== */
  --blur-*: ...;
  --backdrop-blur-*: ...;
  --brightness-*: ...;
  --backdrop-brightness-*: ...;
  --contrast-*: ...;
  --backdrop-contrast-*: ...;
  --grayscale-*: ...;
  --backdrop-grayscale-*: ...;
  --hue-rotate-*: ...;
  --backdrop-hue-rotate-*: ...;
  --invert-*: ...;
  --backdrop-invert-*: ...;
  --saturate-*: ...;
  --backdrop-saturate-*: ...;
  --sepia-*: ...;
  --backdrop-sepia-*: ...;
  --opacity-*: ...;
  --backdrop-opacity-*: ...;

  /* ========================================
     13. トランジション・アニメーション
     ======================================== */
  --transition-property-*: ...;
  --transition-duration-*: ...;
  --transition-delay-*: ...;
  --ease-*: ...;
  --animate-*: ...;

  /* ========================================
     14. その他のユーティリティ変数
     ======================================== */
  --cursor-*: ...;
  --list-style-type-*: ...;
  --list-style-image-*: ...;
  --object-position-*: ...;
  --content-*: ...;
  --background-image-*: ...;
  --gradient-color-stop-positions-*: ...;

  /* ========================================
     15. デフォルト値(常に最後)
     ======================================== */
  --default-transition-duration: 150ms;
  --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  --default-font-family: var(--font-sans);
  --default-font-feature-settings: normal;
  --default-font-variation-settings: normal;
  --default-mono-font-family: var(--font-mono);
  --default-mono-font-feature-settings: normal;
  --default-mono-font-variation-settings: normal;
  --default-border-width: 1px;
  --default-outline-width: 1px;
  --default-ring-width: 3px;
  --default-ring-color: currentcolor;
}

utilities.tsで使用されている全テーマキー一覧

レイアウト

  • --z-index, --order
  • --grid-column, --grid-column-start, --grid-column-end
  • --grid-row, --grid-row-start, --grid-row-end
  • --grid-auto-columns, --grid-auto-rows
  • --grid-template-columns, --grid-template-rows
  • --columns, --flex-basis
  • --aspect, --line-clamp

スペーシング

  • --spacing, --margin, --padding, --inset
  • --space, --gap
  • --scroll-margin, --scroll-padding
  • --border-spacing

サイズ

  • --width, --min-width, --max-width
  • --height, --min-height, --max-height
  • --size, --container

カラー

  • --color
  • --background-color, --text-color
  • --border-color, --divide-color
  • --ring-color, --ring-offset-color
  • --accent-color, --caret-color
  • --fill, --stroke
  • --text-decoration-color, --outline-color
  • --box-shadow-color, --drop-shadow-color, --text-shadow-color

タイポグラフィ

  • --text (with --line-height, --letter-spacing, --font-weight)
  • --font, --font-weight
  • --tracking, --leading
  • --text-indent, --text-decoration-thickness, --text-underline-offset

ボーダー

  • --radius
  • --border-width, --divide-width
  • --outline-width, --outline-offset
  • --ring-width, --ring-offset-width
  • --stroke-width

シャドウ

  • --shadow, --inset-shadow
  • --drop-shadow, --text-shadow

トランスフォーム

  • --transform-origin, --perspective-origin, --perspective
  • --translate, --scale, --rotate, --skew

エフェクト

  • --blur, --backdrop-blur
  • --brightness, --backdrop-brightness
  • --contrast, --backdrop-contrast
  • --grayscale, --backdrop-grayscale
  • --hue-rotate, --backdrop-hue-rotate
  • --invert, --backdrop-invert
  • --saturate, --backdrop-saturate
  • --sepia, --backdrop-sepia
  • --opacity, --backdrop-opacity

トランジション・アニメーション

  • --transition-property, --transition-duration, --transition-delay
  • --ease, --animate

その他

  • --cursor
  • --list-style-type, --list-style-image
  • --object-position
  • --content
  • --background-image
  • --gradient-color-stop-positions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment