>_FoxiRef
>_/cheatsheet/tailwind
TailwindCSS

TailwindCSS チートシート

よく使うTailwindCSSユーティリティクラス集

#レスポンシブブレークポイント

クラスCSS説明
sm:@media (min-width: 640px)小さい画面以上
md:@media (min-width: 768px)中くらいの画面以上
lg:@media (min-width: 1024px)大きい画面以上
xl:@media (min-width: 1280px)特大画面以上
2xl:@media (min-width: 1536px)超特大画面以上

#状態(バリアント)

クラスCSS説明
hover::hoverマウスオーバー時
focus::focusフォーカス時
active::activeクリック/タップ中
disabled::disabled無効時
first::first-child最初の子要素
last::last-child最後の子要素
odd::nth-child(odd)奇数番目の子要素
even::nth-child(even)偶数番目の子要素
group-hover:.group:hover &親グループホバー時
dark:@media (prefers-color-scheme: dark)ダークモード時

#間隔(スペーシング)

クラスCSS説明
p-{size}padding全体のパディング
px-{size}padding-left/right左右のパディング
py-{size}padding-top/bottom上下のパディング
pt/pr/pb/pl-{size}padding-top/right/bottom/left個別方向のパディング
m-{size}margin全体のマージン
mx-{size}margin-left/right左右のマージン
my-{size}margin-top/bottom上下のマージン
mt/mr/mb/ml-{size}margin-top/right/bottom/left個別方向のマージン
mx-automargin: 0 auto水平中央揃え
gap-{size}gapFlex/Gridの間隔
gap-x-{size}column-gap横方向の間隔
gap-y-{size}row-gap縦方向の間隔
space-x-{size}> * + * { margin-left }子要素の横方向の間隔
space-y-{size}> * + * { margin-top }子要素の縦方向の間隔

#サイズ

クラスCSS説明
w-{size}width
w-fullwidth: 100%全幅
w-screenwidth: 100vw画面幅
w-autowidth: auto自動幅
w-fitwidth: fit-contentコンテンツに合わせる
min-w-0min-width: 0最小幅0
min-w-fullmin-width: 100%最小幅100%
max-w-{size}max-width最大幅
max-w-screen-{bp}max-width: breakpointブレークポイントの最大幅
h-{size}height高さ
h-fullheight: 100%全高
h-screenheight: 100vh画面高さ
min-h-screenmin-height: 100vh最小画面高さ
max-h-{size}max-height最大高さ
size-{size}width + height幅と高さを同時に設定

#ディスプレイ

クラスCSS説明
blockdisplay: blockブロック要素
inline-blockdisplay: inline-blockインラインブロック
inlinedisplay: inlineインライン要素
flexdisplay: flexFlexコンテナ
inline-flexdisplay: inline-flexインラインFlex
griddisplay: gridGridコンテナ
inline-griddisplay: inline-gridインラインGrid
hiddendisplay: none非表示
contentsdisplay: contentsコンテンツのみ

#フレックスボックス

クラスCSS説明
flex-rowflex-direction: row横方向
flex-colflex-direction: column縦方向
flex-row-reverseflex-direction: row-reverse横方向逆順
flex-col-reverseflex-direction: column-reverse縦方向逆順
flex-wrapflex-wrap: wrap折り返し許可
flex-nowrapflex-wrap: nowrap折り返しなし
flex-1flex: 1 1 0%残りの空間を埋める
flex-autoflex: 1 1 auto自動サイズ
flex-noneflex: none固定サイズ
growflex-grow: 1拡大許可
grow-0flex-grow: 0拡大禁止
shrinkflex-shrink: 1縮小許可
shrink-0flex-shrink: 0縮小禁止

#配置

クラスCSS説明
justify-startjustify-content: flex-startメイン軸の開始
justify-centerjustify-content: centerメイン軸の中央
justify-endjustify-content: flex-endメイン軸の終端
justify-betweenjustify-content: space-between両端揃え
justify-aroundjustify-content: space-around均等配置
justify-evenlyjustify-content: space-evenly等間隔配置
items-startalign-items: flex-startクロス軸の開始
items-centeralign-items: centerクロス軸の中央
items-endalign-items: flex-endクロス軸の終端
items-baselinealign-items: baselineベースライン揃え
items-stretchalign-items: stretch引き伸ばし
self-autoalign-self: auto個別配置自動
self-startalign-self: flex-start個別配置開始
self-centeralign-self: center個別配置中央
self-endalign-self: flex-end個別配置終端

#グリッド

クラスCSS説明
grid-cols-{n}grid-template-columns: repeat(n, 1fr)n列
grid-rows-{n}grid-template-rows: repeat(n, 1fr)n行
col-span-{n}grid-column: span nn列にまたがる
col-start-{n}grid-column-start: nn列目から開始
col-end-{n}grid-column-end: nn列目で終了
row-span-{n}grid-row: span nn行にまたがる
row-start-{n}grid-row-start: nn行目から開始
row-end-{n}grid-row-end: nn行目で終了
auto-cols-autogrid-auto-columns: auto自動列サイズ
auto-cols-frgrid-auto-columns: 1fr自動列1fr
auto-rows-autogrid-auto-rows: auto自動行サイズ

#位置

クラスCSS説明
staticposition: static静的位置
relativeposition: relative相対位置
absoluteposition: absolute絶対位置
fixedposition: fixed固定位置
stickyposition: stickyスティッキー位置
top-{size}top上からの距離
right-{size}right右からの距離
bottom-{size}bottom下からの距離
left-{size}left左からの距離
inset-{size}top/right/bottom/left全方向の距離
inset-x-{size}left/right左右の距離
inset-y-{size}top/bottom上下の距離
z-{n}z-indexZインデックス
z-autoz-index: autoZインデックス自動

#タイポグラフィ

クラスCSS説明
font-sansfont-family: sans-serifサンセリフフォント
font-seriffont-family: serifセリフフォント
font-monofont-family: monospace等幅フォント
text-xsfont-size: 0.75rem極小テキスト
text-smfont-size: 0.875rem小さいテキスト
text-basefont-size: 1rem基本テキスト
text-lgfont-size: 1.125rem大きいテキスト
text-xlfont-size: 1.25rem特大テキスト
text-2xl ~ 9xlfont-size: 1.5rem ~ 8remより大きいサイズ
font-thinfont-weight: 100最も細い
font-lightfont-weight: 300細い
font-normalfont-weight: 400通常
font-mediumfont-weight: 500中太
font-semiboldfont-weight: 600セミボールド
font-boldfont-weight: 700ボールド
italicfont-style: italicイタリック
not-italicfont-style: normalイタリック解除
leading-{size}line-height行の高さ
tracking-{size}letter-spacing文字間隔

#テキスト配置と装飾

クラスCSS説明
text-lefttext-align: left左揃え
text-centertext-align: center中央揃え
text-righttext-align: right右揃え
text-justifytext-align: justify両端揃え
underlinetext-decoration: underline下線
line-throughtext-decoration: line-through取り消し線
no-underlinetext-decoration: none装飾なし
uppercasetext-transform: uppercase大文字
lowercasetext-transform: lowercase小文字
capitalizetext-transform: capitalize先頭大文字
truncateoverflow: hidden; text-overflow: ellipsis省略記号で切り捨て
line-clamp-{n}-webkit-line-clamp: nn行に制限
whitespace-nowrapwhite-space: nowrap折り返しなし
break-wordsword-wrap: break-word単語で改行

#

クラスCSS説明
text-{color}-{shade}colorテキストの色
bg-{color}-{shade}background-color背景色
bg-gradient-to-{dir}background-image: linear-gradientグラデーションの方向
from-{color}from colorグラデーション開始色
via-{color}via colorグラデーション中間色
to-{color}to colorグラデーション終了色
text-transparentcolor: transparent透明テキスト
bg-transparentbackground-color: transparent透明背景
text-currentcolor: currentColor現在の色を継承

#ボーダー

クラスCSS説明
borderborder-width: 1px1pxボーダー
border-{n}border-width: npxnピクセルボーダー
border-t/r/b/l-{n}border-top/right/bottom/left-width方向別ボーダー
border-{color}border-colorボーダーの色
border-solidborder-style: solid実線
border-dashedborder-style: dashed破線
border-dottedborder-style: dotted点線
border-noneborder-style: noneボーダーなし
roundedborder-radius: 0.25remわずかに丸く
rounded-mdborder-radius: 0.375rem中程度に丸く
rounded-lgborder-radius: 0.5rem大きく丸く
rounded-xlborder-radius: 0.75rem非常に丸く
rounded-fullborder-radius: 9999px完全な円形
rounded-noneborder-radius: 0角なし
rounded-t/r/b/l-{size}border-radius (corners)特定のコーナー

#エフェクト

クラスCSS説明
shadow-smbox-shadow: small小さい影
shadowbox-shadow: default標準の影
shadow-mdbox-shadow: medium中程度の影
shadow-lgbox-shadow: large大きい影
shadow-xlbox-shadow: extra large非常に大きい影
shadow-2xlbox-shadow: 2x large最大の影
shadow-innerbox-shadow: inset内側の影
shadow-nonebox-shadow: none影なし
opacity-{n}opacity: n%不透明度(0-100)
blurfilter: blur(8px)ぼかし
blur-{size}filter: blur(size)ぼかしの程度
brightness-{n}filter: brightness(n%)明るさ
contrast-{n}filter: contrast(n%)コントラスト
grayscalefilter: grayscale(100%)グレースケール
invertfilter: invert(100%)反転

#トランジションとアニメーション

クラスCSS説明
transitiontransition-property: all標準トランジション
transition-alltransition-property: allすべてのトランジション
transition-colorstransition-property: colors色のトランジション
transition-opacitytransition-property: opacity不透明度のトランジション
transition-transformtransition-property: transform変形のトランジション
duration-{ms}transition-duration: ms持続時間
ease-lineartransition-timing: linearリニアイージング
ease-intransition-timing: ease-inイーズイン
ease-outtransition-timing: ease-outイーズアウト
ease-in-outtransition-timing: ease-in-outイーズインアウト
delay-{ms}transition-delay: ms遅延
animate-spinanimation: spin回転アニメーション
animate-pinganimation: pingピンアニメーション
animate-pulseanimation: pulseパルスアニメーション
animate-bounceanimation: bounceバウンスアニメーション

#変形

クラスCSS説明
scale-{n}transform: scale(n)スケール
scale-x-{n}transform: scaleX(n)横方向スケール
scale-y-{n}transform: scaleY(n)縦方向スケール
rotate-{deg}transform: rotate(deg)回転
translate-x-{size}transform: translateX横方向移動
translate-y-{size}transform: translateY縦方向移動
skew-x-{deg}transform: skewX(deg)横方向傾斜
skew-y-{deg}transform: skewY(deg)縦方向傾斜
origin-centertransform-origin: center変形基準点 中央
origin-toptransform-origin: top変形基準点 上
origin-bottomtransform-origin: bottom変形基準点 下

#オーバーフローとその他

クラスCSS説明
overflow-autooverflow: auto必要時スクロール
overflow-hiddenoverflow: hiddenはみ出し非表示
overflow-scrolloverflow: scroll常にスクロール
overflow-visibleoverflow: visibleはみ出し表示
overflow-x-{value}overflow-x横方向オーバーフロー
overflow-y-{value}overflow-y縦方向オーバーフロー
cursor-pointercursor: pointerポインターカーソル
cursor-not-allowedcursor: not-allowed禁止カーソル
pointer-events-nonepointer-events: noneクリック無効
select-noneuser-select: none選択不可
select-textuser-select: textテキスト選択可
select-alluser-select: allクリックで全選択
sr-onlyscreen reader onlyスクリーンリーダー専用

#カラーパレット

slate
gray
zinc
red
orange
amber
yellow
lime
green
emerald
teal
cyan
sky
blue
indigo
violet
purple
fuchsia
pink
rose

💡 Click a color block to copy the class name (e.g., blue-500)

Usage: text-{color}-{shade}, bg-{color}-{shade}, border-{color}-{shade}

#サイズスケール参照

クラスクラス
00pxpx1px
0.50.125rem (2px)10.25rem (4px)
20.5rem (8px)30.75rem (12px)
41rem (16px)51.25rem (20px)
61.5rem (24px)82rem (32px)
102.5rem (40px)123rem (48px)
164rem (64px)205rem (80px)
246rem (96px)328rem (128px)

#よくある質問 (FAQ)

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

TailwindCSS チートシート - クラスリファレンス | Foxi Dev Reference