Tailwind 类名速查

搜索类名
布局 Layout
flex弹性布局
grid网格布局
block块级元素
inline-block行内块元素
hidden隐藏元素
contents内容直接渲染
Flex 方向
flex-row水平排列
flex-col垂直排列
flex-wrap允许换行
flex-nowrap不换行
Flex 对齐
justify-start/center/end/between/around/evenly主轴对齐
items-start/center/end/baseline/stretch交叉轴对齐
self-start/center/end/auto单个项目对齐
place-items-center同时设置 items 和 justify-items
间距 Spacing
p/p-x/p-y/p-t/p-r/p-b/p-l-{n}内边距
m/m-x/m-y/m-t/m-r/m-b/m-l-{n}外边距
space-x/y-{n}子元素间距
gap/gap-x/gap-y-{n}网格/弹性间距
尺寸 Sizing
w/n/min-w/max-w宽度相关
h/min-h/max-h高度相关
w-full/h-screen100%宽高
w-screen/h-screen视口尺寸
aspect-square/video/portrait宽高比
排版 Typography
text-xs/sm/base/lg/xl/2xl/3xl字号大小
font-light/normal/medium/semibold/bold字重
text-left/center/right/justify文本对齐
truncate/overflow-hidden/scroll文本溢出
leading/tight/normal/relaxed/loose行高
tracking-tighter/tight/normal/wide/wider字间距
颜色 Colors
text-{color}-{n}文字颜色
bg-{color}-{n}背景颜色
border-{color}-{n}边框颜色
from-{color}-via-{color}-to-{color}渐变颜色
边框 Borders
rounded/rounded-md/rounded-lg/rounded-xl/full圆角
border/border-0/border-2/border-4边框宽度
border-x/y/t/r/b单边边框
outline/outline-offset外轮廓
效果 Effects
shadow/sm/md/lg/xl/2xl/inner/none阴影
opacity-0/25/50/75/100透明度
blur/sm/md/lg/xl/none模糊
brightness-0/50/75/100/125/150/200亮度
contrast-0/50/75/100/125/150/200对比度
交互 Interaction
cursor-auto/default/pointer/move/grab鼠标样式
select-none/text/all/auto文本选择
resize/resize-none/resize-y/resize-x调整大小
pointer-events-none/auto指针事件
过渡动画 Transitions
transition/transition-all过渡效果
duration-75/100/150/200/300/500/700/1000过渡时长
ease-linear/in/out/in-out过渡曲线
animate-spin/ping/pulse/bounce动画效果
变换 Transform
scale-x/y/{n}缩放
rotate-{n}旋转
translate-x/y/{n}平移
skew-x/y-{n}倾斜
origin-center/top/bottom/left/right变换原点
响应式 Responsive
sm: md: lg: xl: 2xl:断点前缀
@container容器查询
伪类 Variants
hover: focus: active:交互状态
disabled: checked: required:表单状态
first: last: odd: even:子元素位置
group-hover: peer-hover:父子兄弟状态
网格 Grid
grid-cols-{n}列数
grid-rows-{n}行数
col-span-{n}/full跨列
row-span-{n}/full跨行
col/row-start-{n}/end-{n}起止位置
定位 Position
static/fixed/absolute/relative/sticky定位方式
inset/t/r/b/l/x/y-{n}偏移量
z-0/10/20/30/40/50/auto层级