tailwindcss-fundamentals-v4 by josiahsiegel/claude-plugin-marketplace
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill tailwindcss-fundamentals-v4Tailwind CSS v4.0 于 2025 年 1 月 22 日发布,其特点包括基于 Rust 引擎的完全重写、CSS 优先的配置以及显著的性能改进。
| 功能 | v3 | v4 |
|---|---|---|
| 配置方式 | JavaScript (tailwind.config.js) | CSS 优先 (@theme 指令) |
| 引擎 | Node.js | Rust (快 10 倍) |
| 颜色格式 | hex/rgb | OKLCH (感知均匀) |
| 插件 | JS 文件 | @plugin 指令 |
| 自定义工具类 | JS 配置 | @utility 指令 |
| PostCSS 导入 | postcss-import | 内置 |
| Autoprefixer | 必需 | 内置 |
| CSS 嵌套 | postcss-nested |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 内置 |
| 内容检测 | 显式配置 | 自动 |
npm install -D tailwindcss @tailwindcss/vite
// vite.config.js
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [tailwindcss()]
})
npm install -D tailwindcss @tailwindcss/postcss
// postcss.config.mjs
export default {
plugins: {
'@tailwindcss/postcss': {}
}
}
/* app.css - 唯一必需的 CSS 文件 */
@import "tailwindcss";
用基于 CSS 的配置替换 tailwind.config.js:
@import "tailwindcss";
@theme {
/* 使用现代 oklch 的颜色 */
--color-primary: oklch(0.6 0.2 250);
--color-secondary: oklch(0.7 0.15 180);
--color-accent: oklch(0.8 0.2 30);
/* 排版 */
--font-display: "Satoshi", sans-serif;
--font-body: "Inter", sans-serif;
/* 自定义间距 */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 2rem;
--spacing-xl: 4rem;
/* 自定义断点 */
--breakpoint-xs: 475px;
--breakpoint-3xl: 1920px;
}
| 类别 | 变量模式 | 示例 |
|---|---|---|
| 颜色 | --color-* | --color-brand-500 |
| 字体 | --font-* | --font-heading |
| 间距 | --spacing-* | --spacing-4 |
| 断点 | --breakpoint-* | --breakpoint-3xl |
| 圆角 | --radius-* | --radius-lg |
| 阴影 | --shadow-* | --shadow-xl |
| 动画 | --animate-* | --animate-fade-in |
| 缓动函数 | --ease-* | --ease-bounce |
@theme {
/* 从零开始 - 禁用所有默认主题值 */
--*: initial;
/* 仅定义你需要的 */
--spacing: 4px;
--font-body: Inter, sans-serif;
--color-primary: oklch(0.72 0.11 221.19);
--color-secondary: oklch(0.74 0.17 40.24);
}
/* 在 CSS 中定义自定义工具类 */
@utility content-auto {
content-visibility: auto;
}
@utility text-balance {
text-wrap: balance;
}
@utility scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
@utility scrollbar-hide::-webkit-scrollbar {
display: none;
}
用法:
<div class="content-auto scrollbar-hide">
<h1 class="text-balance">长标题应能很好地平衡</h1>
</div>
/* 接受值的工具类 */
@utility tab-* {
tab-size: --value(integer);
}
@utility text-shadow-* {
text-shadow: 0 0 --value([length]) currentColor;
}
/* 引用主题变量 */
@utility gap-safe-* {
gap: max(--value(--spacing-*), env(safe-area-inset-bottom));
}
用法:
<pre class="tab-4">使用 4 空格制表符的代码</pre>
<h1 class="text-shadow-[2px]">发光文本</h1>
<div class="gap-safe-4">考虑安全区域的间距</div>
/* 带选择器的深色模式 */
@custom-variant dark (&:where(.dark, .dark *));
/* 自定义状态变体 */
@custom-variant hocus (&:hover, &:focus);
@custom-variant group-hocus (:merge(.group):hover &, :merge(.group):focus &);
/* 数据属性变体 */
@custom-variant data-loading (&[data-loading="true"]);
@custom-variant data-active (&[data-state="active"]);
/* 子选择器 */
@custom-variant children (& > *);
@custom-variant not-first (& > *:not(:first-child));
用法:
<button class="hocus:bg-blue-600">悬停或聚焦</button>
<div class="data-loading:opacity-50" data-loading="true">加载中...</div>
<ul class="children:border-b not-first:pt-2">
<li>项目 1</li>
<li>项目 2</li>
</ul>
@import "tailwindcss";
/* 加载官方插件 */
@plugin "@tailwindcss/typography";
@plugin "@tailwindcss/forms";
@plugin "@tailwindcss/container-queries";
/* 加载本地插件 */
@plugin "./my-plugin.js";
@plugin "@tailwindcss/typography" {
className: wysiwyg;
}
@plugin "@tailwindcss/forms" {
strategy: class;
}
@import "tailwindcss" prefix(tw);
@theme {
/* 定义时不带前缀 */
--font-display: "Satoshi", sans-serif;
}
<!-- 使用时带前缀 -->
<div class="tw:flex tw:bg-red-500 tw:hover:bg-red-600">
内容
</div>
生成的 CSS 变量包含前缀:
:root {
--tw-font-display: "Satoshi", sans-serif;
}
/* v3 方法 (已弃用) */
.old-way {
background-color: theme(colors.red.500);
}
/* v4 方法 */
.new-way {
background-color: var(--color-red-500);
}
/* 在媒体查询中,使用 CSS 变量名 */
@media (width >= theme(--breakpoint-xl)) {
/* 样式 */
}
<!-- 弹性盒子 -->
<div class="flex flex-col md:flex-row items-center justify-between gap-4">
<!-- 网格 -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- 容器 -->
<div class="container mx-auto px-4">
<!-- 内边距 -->
<div class="p-4 px-6 py-2">
<!-- 外边距 -->
<div class="m-4 mx-auto my-8">
<!-- 间隙 -->
<div class="gap-4 gap-x-6 gap-y-2">
<!-- 字体大小 -->
<p class="text-sm md:text-base lg:text-lg">
<!-- 字体粗细 -->
<h1 class="font-bold">
<!-- 文本颜色 -->
<p class="text-gray-600 dark:text-gray-300">
<!-- 行高 -->
<p class="leading-relaxed">
<!-- 背景 -->
<div class="bg-white dark:bg-gray-900">
<!-- 文本 -->
<p class="text-blue-600">
<!-- 边框 -->
<div class="border border-gray-200">
<!-- 轮廓环 -->
<button class="focus:ring-2 focus:ring-blue-500">
<!-- 宽度 -->
<div class="w-full md:w-1/2 lg:w-1/3">
<!-- 高度 -->
<div class="h-screen min-h-[500px]">
<!-- 最大宽度 -->
<div class="max-w-xl mx-auto">
<!-- 使用任何 CSS 值 -->
<div class="top-[117px] left-[calc(50%-4rem)]">
<!-- 使用 CSS 变量 -->
<div class="bg-[var(--my-color)]">
<!-- 复杂值 -->
<div class="grid-cols-[1fr_500px_2fr]">
<!-- 强制 !important -->
<div class="!mt-0">
<!-- 与变体结合 -->
<div class="hover:!bg-red-500">
| 功能 | v3 要求 | v4 |
|---|---|---|
| @import 处理 | postcss-import | 内置 |
| 厂商前缀 | autoprefixer | 内置 |
| CSS 嵌套 | postcss-nested | 内置 |
| 内容检测 | content 配置 | 自动 |
/* 使用原生 CSS 层 */
@layer base {
h1 {
@apply text-2xl font-bold;
}
}
@layer components {
.btn {
@apply px-4 py-2 rounded font-medium;
}
}
@layer utilities {
/* 通过 @utility 指令定义自定义工具类 */
}
OKLCH 提供感知均匀的颜色、更好的渐变和广色域支持:
@theme {
/* OKLCH 格式: oklch(亮度 色度 色调) */
/* 亮度: 0-1, 色度: 0-0.4, 色调: 0-360 */
/* 主色调板 - 调整 L 值生成不同深浅 */
--color-primary-50: oklch(0.97 0.02 250);
--color-primary-100: oklch(0.93 0.04 250);
--color-primary-500: oklch(0.55 0.2 250); /* 基础色 */
--color-primary-600: oklch(0.48 0.2 250);
--color-primary-900: oklch(0.27 0.12 250);
/* 语义化颜色 */
--color-success: oklch(0.6 0.15 145);
--color-warning: oklch(0.75 0.15 65);
--color-error: oklch(0.55 0.2 25);
}
平滑缩放,无断点跳跃:
@theme {
/* 使用 clamp() 的流式字体大小 */
/* clamp(最小值, 首选值, 最大值) */
--text-fluid-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-fluid-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
--text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
--text-fluid-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
--text-fluid-xl: clamp(1.25rem, 1rem + 1.25vw, 1.5rem);
--text-fluid-2xl: clamp(1.5rem, 1.1rem + 2vw, 2rem);
--text-fluid-3xl: clamp(1.875rem, 1.2rem + 3.375vw, 2.5rem);
--text-fluid-4xl: clamp(2.25rem, 1rem + 6.25vw, 3.5rem);
}
重要:始终将 vw 与 rem 结合使用以确保可访问性(尊重缩放)。
@theme {
/* 随视口缩放的流式间距 */
--spacing-fluid-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
--spacing-fluid-md: clamp(1rem, 0.75rem + 1.25vw, 2rem);
--spacing-fluid-lg: clamp(2rem, 1rem + 3vw, 4rem);
--spacing-fluid-section: clamp(4rem, 2rem + 8vw, 8rem);
}
@theme {
/* === 颜色 === */
--color-primary: oklch(0.6 0.2 250);
--color-secondary: oklch(0.7 0.15 180);
--color-success: oklch(0.6 0.15 145);
--color-error: oklch(0.55 0.2 25);
/* === 排版 === */
--font-sans: 'Inter Variable', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
/* === 流式排版 === */
--text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
--text-fluid-lg: clamp(1.25rem, 1rem + 1.25vw, 2rem);
/* === 间距 === */
--spacing-page: 2rem;
--spacing-fluid-section: clamp(4rem, 2rem + 8vw, 8rem);
/* === 边框圆角 === */
--radius-sm: 0.25rem;
--radius-md: 0.5rem;
--radius-lg: 0.75rem;
/* === 阴影 === */
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.05);
--shadow-md: 0 4px 6px oklch(0 0 0 / 0.07);
/* === 缓动函数 === */
--ease-fluid: cubic-bezier(0.3, 0, 0, 1);
--ease-snappy: cubic-bezier(0.2, 0, 0, 1);
}
/* 良好 - 单一用途的工具类 */
@utility truncate-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
@utility text-balance {
text-wrap: balance;
}
@utility content-auto {
content-visibility: auto;
contain-intrinsic-size: auto 500px;
}
/* 针对有缺口的设备的安全区域工具类 */
@utility safe-area-pb {
padding-bottom: env(safe-area-inset-bottom);
}
@utility safe-area-pt {
padding-top: env(safe-area-inset-top);
}
/* 避免 - 过于复杂,应使用组件 */
@utility card-fancy {
/* 属性过多 - 使用 @layer components */
}
始终按渐进方式构建响应式类:
<!-- 基础 (移动端) -> sm -> md -> lg -> xl -> 2xl -->
<div class="
text-sm md:text-base lg:text-lg
p-4 md:p-6 lg:p-8
grid-cols-1 md:grid-cols-2 lg:grid-cols-3
">
内容
</div>
<!-- 触摸友好的按钮 (最小 44px - WCAG 2.2) -->
<button class="
min-h-11 min-w-11 px-4 py-2.5
bg-primary-600 hover:bg-primary-700 text-white
rounded-lg font-medium
focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2
transition-colors motion-reduce:transition-none
">
按钮文本
</button>
/* v3: border 默认使用 gray-200 */
/* v4: border 使用 currentColor */
/* 修复:显式设置颜色 */
@theme {
--default-border-color: var(--color-gray-200);
}
/* v3: ring 是 3px blue-500 */
/* v4: ring 是 1px currentColor */
/* 修复:恢复 v3 行为 */
@theme {
--default-ring-width: 3px;
--default-ring-color: var(--color-blue-500);
}
/* v4: 按钮使用 cursor: default */
/* 修复:如果需要,全局添加 pointer */
button {
cursor: pointer;
}
每周安装量
157
仓库
GitHub 星标数
21
首次出现
2026 年 1 月 24 日
安全审计
已安装于
opencode126
codex121
gemini-cli120
github-copilot112
claude-code106
cursor100
Tailwind CSS v4.0 was released January 22, 2025, featuring a complete rewrite with a Rust-based engine, CSS-first configuration, and significant performance improvements.
| Feature | v3 | v4 |
|---|---|---|
| Configuration | JavaScript (tailwind.config.js) | CSS-first (@theme directive) |
| Engine | Node.js | Rust (10x faster) |
| Color format | hex/rgb | OKLCH (perceptually uniform) |
| Plugins | JS files | @plugin directive |
| Custom utilities | JS config | @utility directive |
| PostCSS imports | postcss-import | Built-in |
| Autoprefixer | Required | Built-in |
| CSS nesting | postcss-nested | Built-in |
| Content detection | Explicit config | Automatic |
npm install -D tailwindcss @tailwindcss/vite
// vite.config.js
import tailwindcss from '@tailwindcss/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [tailwindcss()]
})
npm install -D tailwindcss @tailwindcss/postcss
// postcss.config.mjs
export default {
plugins: {
'@tailwindcss/postcss': {}
}
}
/* app.css - The only required CSS file */
@import "tailwindcss";
Replace tailwind.config.js with CSS-based configuration:
@import "tailwindcss";
@theme {
/* Colors using modern oklch */
--color-primary: oklch(0.6 0.2 250);
--color-secondary: oklch(0.7 0.15 180);
--color-accent: oklch(0.8 0.2 30);
/* Typography */
--font-display: "Satoshi", sans-serif;
--font-body: "Inter", sans-serif;
/* Custom spacing */
--spacing-xs: 0.25rem;
--spacing-sm: 0.5rem;
--spacing-md: 1rem;
--spacing-lg: 2rem;
--spacing-xl: 4rem;
/* Custom breakpoints */
--breakpoint-xs: 475px;
--breakpoint-3xl: 1920px;
}
| Category | Variable Pattern | Example |
|---|---|---|
| Colors | --color-* | --color-brand-500 |
| Fonts | --font-* | --font-heading |
| Spacing | --spacing-* | --spacing-4 |
| Breakpoints | --breakpoint-* |
@theme {
/* Start fresh - disable all default theme values */
--*: initial;
/* Define only what you need */
--spacing: 4px;
--font-body: Inter, sans-serif;
--color-primary: oklch(0.72 0.11 221.19);
--color-secondary: oklch(0.74 0.17 40.24);
}
/* Define custom utility in CSS */
@utility content-auto {
content-visibility: auto;
}
@utility text-balance {
text-wrap: balance;
}
@utility scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}
@utility scrollbar-hide::-webkit-scrollbar {
display: none;
}
Usage:
<div class="content-auto scrollbar-hide">
<h1 class="text-balance">Long headline that should balance nicely</h1>
</div>
/* Utility that accepts values */
@utility tab-* {
tab-size: --value(integer);
}
@utility text-shadow-* {
text-shadow: 0 0 --value([length]) currentColor;
}
/* With theme reference */
@utility gap-safe-* {
gap: max(--value(--spacing-*), env(safe-area-inset-bottom));
}
Usage:
<pre class="tab-4">Code with 4-space tabs</pre>
<h1 class="text-shadow-[2px]">Glowing text</h1>
<div class="gap-safe-4">Safe area aware gap</div>
/* Dark mode with selector */
@custom-variant dark (&:where(.dark, .dark *));
/* Custom state variants */
@custom-variant hocus (&:hover, &:focus);
@custom-variant group-hocus (:merge(.group):hover &, :merge(.group):focus &);
/* Data attribute variants */
@custom-variant data-loading (&[data-loading="true"]);
@custom-variant data-active (&[data-state="active"]);
/* Child selectors */
@custom-variant children (& > *);
@custom-variant not-first (& > *:not(:first-child));
Usage:
<button class="hocus:bg-blue-600">Hover or focus</button>
<div class="data-loading:opacity-50" data-loading="true">Loading...</div>
<ul class="children:border-b not-first:pt-2">
<li>Item 1</li>
<li>Item 2</li>
</ul>
@import "tailwindcss";
/* Load official plugins */
@plugin "@tailwindcss/typography";
@plugin "@tailwindcss/forms";
@plugin "@tailwindcss/container-queries";
/* Load local plugin */
@plugin "./my-plugin.js";
@plugin "@tailwindcss/typography" {
className: wysiwyg;
}
@plugin "@tailwindcss/forms" {
strategy: class;
}
@import "tailwindcss" prefix(tw);
@theme {
/* Define without prefix */
--font-display: "Satoshi", sans-serif;
}
<!-- Use with prefix -->
<div class="tw:flex tw:bg-red-500 tw:hover:bg-red-600">
Content
</div>
Generated CSS variables include prefix:
:root {
--tw-font-display: "Satoshi", sans-serif;
}
/* v3 approach (deprecated) */
.old-way {
background-color: theme(colors.red.500);
}
/* v4 approach */
.new-way {
background-color: var(--color-red-500);
}
/* In media queries, use CSS variable names */
@media (width >= theme(--breakpoint-xl)) {
/* styles */
}
<!-- Flexbox -->
<div class="flex flex-col md:flex-row items-center justify-between gap-4">
<!-- Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Container -->
<div class="container mx-auto px-4">
<!-- Padding -->
<div class="p-4 px-6 py-2">
<!-- Margin -->
<div class="m-4 mx-auto my-8">
<!-- Gap -->
<div class="gap-4 gap-x-6 gap-y-2">
<!-- Font size -->
<p class="text-sm md:text-base lg:text-lg">
<!-- Font weight -->
<h1 class="font-bold">
<!-- Text color -->
<p class="text-gray-600 dark:text-gray-300">
<!-- Line height -->
<p class="leading-relaxed">
<!-- Background -->
<div class="bg-white dark:bg-gray-900">
<!-- Text -->
<p class="text-blue-600">
<!-- Border -->
<div class="border border-gray-200">
<!-- Ring -->
<button class="focus:ring-2 focus:ring-blue-500">
<!-- Width -->
<div class="w-full md:w-1/2 lg:w-1/3">
<!-- Height -->
<div class="h-screen min-h-[500px]">
<!-- Max width -->
<div class="max-w-xl mx-auto">
<!-- Use any CSS value -->
<div class="top-[117px] left-[calc(50%-4rem)]">
<!-- With CSS variables -->
<div class="bg-[var(--my-color)]">
<!-- Complex values -->
<div class="grid-cols-[1fr_500px_2fr]">
<!-- Force important -->
<div class="!mt-0">
<!-- With variants -->
<div class="hover:!bg-red-500">
| Feature | v3 Requirement | v4 |
|---|---|---|
| @import handling | postcss-import | Built-in |
| Vendor prefixing | autoprefixer | Built-in |
| CSS nesting | postcss-nested | Built-in |
| Content detection | content config | Automatic |
/* Use native CSS layers */
@layer base {
h1 {
@apply text-2xl font-bold;
}
}
@layer components {
.btn {
@apply px-4 py-2 rounded font-medium;
}
}
@layer utilities {
/* Custom utilities via @utility directive instead */
}
OKLCH provides perceptually uniform colors, better gradients, and wide gamut support:
@theme {
/* OKLCH format: oklch(lightness chroma hue) */
/* Lightness: 0-1, Chroma: 0-0.4, Hue: 0-360 */
/* Primary palette - adjust L for shades */
--color-primary-50: oklch(0.97 0.02 250);
--color-primary-100: oklch(0.93 0.04 250);
--color-primary-500: oklch(0.55 0.2 250); /* Base */
--color-primary-600: oklch(0.48 0.2 250);
--color-primary-900: oklch(0.27 0.12 250);
/* Semantic colors */
--color-success: oklch(0.6 0.15 145);
--color-warning: oklch(0.75 0.15 65);
--color-error: oklch(0.55 0.2 25);
}
Smooth scaling without breakpoint jumps:
@theme {
/* Fluid type scale using clamp() */
/* clamp(min, preferred, max) */
--text-fluid-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-fluid-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
--text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
--text-fluid-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
--text-fluid-xl: clamp(1.25rem, 1rem + 1.25vw, 1.5rem);
--text-fluid-2xl: clamp(1.5rem, 1.1rem + 2vw, 2rem);
--text-fluid-3xl: clamp(1.875rem, 1.2rem + 3.375vw, 2.5rem);
--text-fluid-4xl: clamp(2.25rem, 1rem + 6.25vw, 3.5rem);
}
Important : Always combine vw with rem for accessibility (respects zoom).
@theme {
/* Fluid spacing that scales with viewport */
--spacing-fluid-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
--spacing-fluid-md: clamp(1rem, 0.75rem + 1.25vw, 2rem);
--spacing-fluid-lg: clamp(2rem, 1rem + 3vw, 4rem);
--spacing-fluid-section: clamp(4rem, 2rem + 8vw, 8rem);
}
@theme {
/* === Colors === */
--color-primary: oklch(0.6 0.2 250);
--color-secondary: oklch(0.7 0.15 180);
--color-success: oklch(0.6 0.15 145);
--color-error: oklch(0.55 0.2 25);
/* === Typography === */
--font-sans: 'Inter Variable', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
/* === Fluid Typography === */
--text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
--text-fluid-lg: clamp(1.25rem, 1rem + 1.25vw, 2rem);
/* === Spacing === */
--spacing-page: 2rem;
--spacing-fluid-section: clamp(4rem, 2rem + 8vw, 8rem);
/* === Border Radius === */
--radius-sm: 0.25rem;
--radius-md: 0.5rem;
--radius-lg: 0.75rem;
/* === Shadows === */
--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.05);
--shadow-md: 0 4px 6px oklch(0 0 0 / 0.07);
/* === Easing === */
--ease-fluid: cubic-bezier(0.3, 0, 0, 1);
--ease-snappy: cubic-bezier(0.2, 0, 0, 1);
}
/* Good - single purpose utilities */
@utility truncate-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
@utility text-balance {
text-wrap: balance;
}
@utility content-auto {
content-visibility: auto;
contain-intrinsic-size: auto 500px;
}
/* Safe area utilities for notched devices */
@utility safe-area-pb {
padding-bottom: env(safe-area-inset-bottom);
}
@utility safe-area-pt {
padding-top: env(safe-area-inset-top);
}
/* Avoid - too complex, use components instead */
@utility card-fancy {
/* Too many properties - use @layer components */
}
Always structure responsive classes progressively:
<!-- Base (mobile) -> sm -> md -> lg -> xl -> 2xl -->
<div class="
text-sm md:text-base lg:text-lg
p-4 md:p-6 lg:p-8
grid-cols-1 md:grid-cols-2 lg:grid-cols-3
">
Content
</div>
<!-- Touch-friendly button (44px minimum - WCAG 2.2) -->
<button class="
min-h-11 min-w-11 px-4 py-2.5
bg-primary-600 hover:bg-primary-700 text-white
rounded-lg font-medium
focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2
transition-colors motion-reduce:transition-none
">
Button Text
</button>
/* v3: border used gray-200 by default */
/* v4: border uses currentColor */
/* Fix: explicitly set color */
@theme {
--default-border-color: var(--color-gray-200);
}
/* v3: ring was 3px blue-500 */
/* v4: ring is 1px currentColor */
/* Fix: restore v3 behavior */
@theme {
--default-ring-width: 3px;
--default-ring-color: var(--color-blue-500);
}
/* v4: buttons use cursor: default */
/* Fix: add pointer globally if needed */
button {
cursor: pointer;
}
Weekly Installs
157
Repository
GitHub Stars
21
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode126
codex121
gemini-cli120
github-copilot112
claude-code106
cursor100
GSAP 框架集成指南:Vue、Svelte 等框架中 GSAP 动画最佳实践
3,000 周安装
JavaScript/TypeScript 测试模式指南:Jest、Vitest 单元与集成测试最佳实践
9,400 周安装
SwiftUI Pro代码审查工具 - 自动检查Swift/SwiftUI代码规范、性能与无障碍性
9,600 周安装
Laravel 专家技能:精通 Laravel 10+、Eloquent ORM 与 PHP 8.2+ 现代开发
9,500 周安装
Google Workspace CLI gws-forms:命令行创建管理Google表单,自动化表单处理
9,700 周安装
提示工程模式:掌握LLM高级提示技术,优化性能与结构化输出
9,600 周安装
Tavily Search:LLM优化的智能网络搜索工具,提供内容摘要和相关性评分
9,800 周安装
--breakpoint-3xl |
| Radius | --radius-* | --radius-lg |
| Shadows | --shadow-* | --shadow-xl |
| Animations | --animate-* | --animate-fade-in |
| Easing | --ease-* | --ease-bounce |