CSS⇄Tailwind対応表
CSSプロパティとTailwindユーティリティクラスの対応を引ける一覧です(Tailwind v4基準・全119項目)。プロパティ名から辞書の解説ページに飛べます。 hover:などのバリアント対応は末尾にまとめています。
レイアウト・配置
blockinline-blockinlinehiddenflex / grid は display-flex・display-grid の項を参照。「hidden」がdisplay: noneに当たる点に注意(visibility: hiddenではない)。
flexinline-flexgridinline-gridorder-1order-firstorder-lastorder-[13]@container名前付きコンテナは @container/{name}。問い合わせる子側は @sm: / @md: などのコンテナバリアントを使う(container-queriesの項を参照)。
grid-cols-subgridgrid-rows-subgridaspect-squareaspect-videoaspect-autoaspect-[4/3]place-items-centerplace-items-startplace-items-stretchplace-content-centerplace-content-betweenflex-rowflex-colflex-row-reverseflex-col-reversejustify-startjustify-centerjustify-betweenjustify-endsafe対応はjustify-center-safe(v4.1+)。
justify-items-startjustify-items-centerjustify-items-stretchitems-startitems-centeritems-enditems-baselineitems-stretchcontent-startcontent-centercontent-betweenflex-wrapflex-nowrapflex-wrap-reverseflex-1flex-autoflex-nonegrowshrink-0basis-1/2「画像が潰れる」対策の flex-shrink: 0 は shrink-0。
grid-cols-3grid-cols-nonegrid-cols-[200px_1fr]grid-cols-[repeat(auto-fit,minmax(120px,1fr))]auto-fit / auto-fill 専用のユーティリティは無く、任意値で書く。頻出ならテーマにカスタム登録する。
staticrelativeabsolutefixedstickyz-10z-50z-auto-z-10z-[999]overflow-hiddenoverflow-x-autooverflow-y-scrolloverflow-clipinset-0inset-x-0top-0-top-4inset-[10%]self-startself-centerself-endself-stretchjustify-self-startjustify-self-centerjustify-self-stretchcol-span-2col-span-fullcol-start-2row-span-2row-span-fullrow-start-1クラス自体は position の項の sticky。効かないときは祖先の overflow を疑う。
v4は物理系ユーティリティ(mx-*等)の実体も論理プロパティ(margin-inline)で出力される。RTL対応はms-*/me-*を選ぶ。
start-0end-0スペーシング・サイズ
p-4px-4py-2pt-2p-[18px]論理プロパティ版は ps-{n}(padding-inline-start)/ pe-{n}(padding-inline-end)。
m-4mx-automt-2-mt-2m-[18px]w-fullw-1/2w-fitw-4w-[52px]max-w-mdmax-w-fullmax-w-nonemax-w-[720px]scroll-mt-14scroll-mt-[56px]mx-4ms-4me-4その他
[--gap:1rem](任意のカスタムプロパティを定義)v3の bg-[var(--brand)] 記法はv4で (--brand) に短縮された。テーマ変数は @theme で定義する。
will-change-transformwill-change-autowill-change-[top,left]table-fixedtable-autov4自体がカスケードレイヤーの上に構築されている。自作CSSは @layer components 等に入れると詳細度の衝突を避けられる。
アニメーション・エフェクト
backdrop-blur-smbackdrop-brightness-50backdrop-blur-[2px]v4でスケール名が変更: v3のbackdrop-blur→backdrop-blur-sm等(blurのリネームに追従)。
blur-smgrayscalebrightness-75blur-[2px]v4でスケール名が変更: v3のblur→blur-sm、blur-sm→blur-xsに改名。
transitiontransition-colorstransition-none所要時間の既定は150ms。v4ではtransition-behavior: allow-discreteを含む。
scale-105rotate-45translate-x-4-translate-y-2translate-x-[5px]v4は個別プロパティ(scale/rotate/translate)で出力される。v3のようなtransformクラスの前置は不要。
animate-spinanimate-pulseanimate-bounceanimate-noneanimate-[wiggle_1s_ease-in-out_infinite]motion-reduce:animate-none の併記を推奨(prefers-reduced-motionの項を参照)。
キーフレーム自体のユーティリティは無い。v4ではCSSの@theme内に定義すると animate-{name} が自動生成される。
背景・装飾
object-coverobject-containobject-fillobject-scale-downbg-whitebg-red-500bg-transparentbg-[#fdfaf3]bg-nonebg-[url('/paper.png')]グラデーションは bg-linear-* / bg-radial / bg-conic(linear-gradientの項を参照)。
bg-coverbg-containbg-autobg-[length:200px_100px]bg-centerbg-topbg-leftbg-[position:20%_80%]borderborder-2border-tborder-dashedv4では border の既定色がcurrentColorに変更された(v3はgray-200)。色の明示を推奨。
rounded-smrounded-mdrounded-lgrounded-fullrounded-[10px]v4でスケール名が変更: v3のrounded→rounded-sm、rounded-sm→rounded-xsに改名。角ごとの指定は rounded-t-* / rounded-tl-* など。
shadow-smshadow-mdshadow-lginset-shadow-smshadow-[0_4px_12px_rgb(0_0_0_/_0.25)]v4でスケール名が変更: v3のshadow→shadow-sm、shadow-sm→shadow-xsに改名。インセット影のinset-shadow-*はv4新設。
accent-pink-500list-nonelist-disclist-decimallist-inside[clip-path:polygon(50%_0,100%_100%,0_100%)]専用ユーティリティは無く任意値で書く。マスクは mask-* ユーティリティ(v4新設)がある。
object-centerobject-topobject-[25%_75%]mix-blend-multiplymix-blend-screenbg-blend-multiplybg-blend-overlayisolateisolation-autoappearance-noneappearance-autooutline-2outline-offset-2outline-hiddenoutline-nonev4で旧outline-noneはoutline-hiddenに改名。新しいoutline-noneは本当にoutlineを消すので、フォーカスリングの代替を必ず用意する。
テキスト・フォント
text-gray-900text-whitetext-red-500/50text-[#b0413e]v4の標準パレットはOKLCHで定義されている。
font-normalfont-semiboldfont-boldfont-[350]leading-noneleading-tightleading-relaxedleading-6leading-[1.8]tracking-tighttracking-normaltracking-widetracking-[0.2em]underlineline-throughno-underline線の色・太さ・スタイルは decoration-{color} / decoration-2 / decoration-wavy。
whitespace-nowrapwhitespace-prewhitespace-pre-wrapcaret-pink-500align-middlealign-topalign-baselineuppercaselowercasecapitalizenormal-casetext-balancetext-prettytext-nowrapレスポンシブ・関数
bg-linear-to-rbg-linear-65v4で bg-gradient-* から bg-linear-* に改名。補間色空間も指定可(bg-linear-to-r/oklch)。
bg-radialbg-radial-[at_25%_25%]bg-radial / bg-conic はv4新設。v3にはユーティリティが無かった。
color-mix()を直接書くユーティリティは無いが、v4の/50透明度記法やcurrentColor混色の実体はcolor-mix()。
[color:light-dark(#1a1712,#fdfaf3)]専用ユーティリティは無い。Tailwindではdark:バリアントで書き分けるのが慣例(scheme-*の指定が前提)。
インタラクション・UX
cursor-pointercursor-not-allowedcursor-helpvisibleinvisiblecollapseinvisible は visibility: hidden(領域は残る)。display: none は hidden(displayの項)。
select-noneselect-textselect-allpointer-events-nonepointer-events-autosnap-startsnap-centersnap-align-noneoverscroll-containoverscroll-noneresizeresize-yresize-none構成要素は scroll-snap-type / scroll-snap-align の項を参照。
バリアント対応(疑似クラス・メディア特性)
@sm: / @md: / @lg:@sm:flex-row → @container (min-width: 24rem) { flex-direction: row }
親に @container を指定した上で使う。ビューポート基準の sm: とは別物。任意幅は @min-[420px]:。
sm: / md: / lg: / xl:md:grid-cols-2 → @media (min-width: 48rem) { grid-template-columns: repeat(2, ...) }
モバイルファースト(min-width基準)。上限側は max-md:、任意幅は min-[420px]:。
hover:hover:bg-red-700 → :hover { background-color: ... }
v4のhover:は「ホバー可能なデバイス」でのみ有効(@media (hover: hover)内)。タッチデバイスでの疑似ホバー問題が仕様レベルで解決された。
odd: / even: / nth-{n}:odd:bg-gray-50 → :nth-child(odd) { background-color: ... }
nth-3: や nth-[3n+1]: のような指定もv4で可能。
nth-of-type-{n}:first-of-type: / last-of-type: もある。
first: / last: / only:first:border-t-0 → :first-child { border-top-width: 0 }
focus-visible:focus-visible:outline-2 → :focus-visible { outline-width: 2px }
単なるfocus:よりfocus-visible:推奨(マウスクリックではリングを出さない)。
dark:bg-gray-900 → @media (prefers-color-scheme: dark) { background-color: ... }
v4のdark:は既定でprefers-color-scheme連動。クラス切り替え式(.darkを親に付ける)にするには@custom-variantで上書きする。
motion-reduce:motion-reduce:animate-none → @media (prefers-reduced-motion: reduce) { animation: none }
逆条件(動きを減らす設定がOFFのときだけ動かす)は motion-safe:。
has-[...]: / has-checked:has-checked:bg-red-50 → :has(:checked) { background-color: ... }
group-has-* で「親のhas状態」も参照できる。
starting:starting:opacity-0 → @starting-style { opacity: 0 }
v4新設。表示された瞬間からのエントリーアニメーションに使う。
user-valid: / user-invalid:user-invalid:border-red-500 → :user-invalid { border-color: ... }
v4新設のバリアント。invalid: と違い入力後にのみ発火する。
focus-within:focus-within:border-red-400 → :focus-within { border-color: ... }