2026年5月1日
如何用 Tailwind CSS v4 从零打造一个新粗野主义网站(分步教程)
学习如何用 Tailwind CSS v4 从零打造一个完整的新粗野主义网站。这篇实操教程会带你走完搭建、配置到构建每个组件的全过程,配有可以直接复制粘贴的代码示例。
Dov Azencot
@DovAzencot好了,各位开发者。我们来做点大胆的东西。
没有理论。没有废话。只有你、我,和一个终端。等这篇教程结束时,你就会拥有一个用 Tailwind CSS v4 打造、功能完整的新粗野主义网站。
我们要聊的是这些:
- 粗黑边框
- 硬朗的投影
- 电光黄点缀
- 厚重的字体
- 零圆角
这不是那种「喏,一个组件」就完事的教程。我们要从零做一整个落地页——主视觉区、功能、定价、页脚,全都要。每一行代码都会讲解。每一个设计决策都会说明理由。
端起你的咖啡。打开你的终端。我们来点粗野的。
What We're Building
开始之前,先看看我们要做的是什么:
一个名为「BoldTask」的虚构 SaaS 产品的落地页——一款不像其他所有项目管理工具那样的项目管理工具。
页面会包含:
- 带 CTA 的主视觉区
- 功能卡片
- 定价表
- 用户评价区
- 页脚
全都带着那股标志性的新粗野主义美学:大胆、高对比、让人无法忽视。
技术栈:
- Tailwind CSS v4(最新最强)
- HTML(如果你更喜欢,也可以用 React/Next.js)
- Google Fonts(Archivo Black + Space Grotesk)
完成用时: 跟着做的话大约 45 到 60 分钟
Step 1: Project Setup (5 minutes)
我们从零开始。这篇教程我用的是一套简单的 HTML 配置,但你可以轻松把它迁移到 React、Next.js 或任何框架上。
Create Your Project
mkdir neobrutalism-website
cd neobrutalism-websiteInitialize npm and Install Tailwind v4
npm init -y
npm install tailwindcss@next @tailwindcss/vite@next注意:我们装的是 Tailwind v4(目前处于 beta,但已经稳定到足以用于生产环境)。@next 标签会帮你拿到 v4。
Create Project Structure
mkdir src
touch src/index.html src/styles.css你的文件夹结构应该是这样:
neobrutalism-website/
├── src/
│ ├── index.html
│ └── styles.css
├── package.json
└── node_modules/
Step 2: Configure Tailwind v4 (3 minutes)
Tailwind v4 有一套全新、更清爽的配置系统。不再用 tailwind.config.js,而是在 CSS 里配置一切。
Create Your Styles File
打开 src/styles.css,加上:
@import "tailwindcss";
/* Tailwind v4 Theme Configuration */
@theme {
/* Fonts */
--font-family-sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
--font-family-display: 'Archivo Black', ui-sans-serif, system-ui, sans-serif;
/* Colors - Neobrutalist Palette */
--color-brutal-yellow: #ffdb33;
--color-brutal-pink: #ff006e;
--color-brutal-cyan: #00f0ff;
--color-brutal-black: #000000;
--color-brutal-white: #ffffff;
--color-brutal-gray: #e5e5e5;
/* Border Radius - Zero for neobrutalism */
--radius-none: 0px;
--radius-sm: 0px;
--radius-md: 0px;
--radius-lg: 0px;
--radius-xl: 0px;
/* Border Widths - Thick */
--border-width-default: 3px;
--border-width-thick: 4px;
--border-width-heavy: 6px;
/* Shadows - Hard offset shadows (no blur) */
--shadow-brutal-sm: 2px 2px 0 0 var(--color-brutal-black);
--shadow-brutal: 4px 4px 0 0 var(--color-brutal-black);
--shadow-brutal-md: 6px 6px 0 0 var(--color-brutal-black);
--shadow-brutal-lg: 8px 8px 0 0 var(--color-brutal-black);
--shadow-brutal-xl: 10px 10px 0 0 var(--color-brutal-black);
/* Spacing adjustments */
--spacing-brutal: 1.5rem;
}
/* Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font-family-sans);
background-color: var(--color-brutal-white);
color: var(--color-brutal-black);
line-height: 1.6;
}
/* Custom Utility Classes */
.border-brutal {
border: 4px solid var(--color-brutal-black);
}
.border-brutal-thick {
border: 6px solid var(--color-brutal-black);
}
.shadow-brutal {
box-shadow: var(--shadow-brutal);
}
.shadow-brutal-lg {
box-shadow: var(--shadow-brutal-lg);
}
.shadow-brutal-xl {
box-shadow: var(--shadow-brutal-xl);
}
/* Hover effect - shadow movement */
.btn-brutal {
transition: all 0.15s ease;
}
.btn-brutal:hover {
transform: translate(2px, 2px);
box-shadow: 2px 2px 0 0 var(--color-brutal-black);
}
.btn-brutal:active {
transform: translate(4px, 4px);
box-shadow: 0px 0px 0 0 var(--color-brutal-black);
}我们刚刚做了什么:
- 设置了自定义配色(黑、白、黄、粉、青)
- 把所有 border-radius 值都清零(新粗野主义 = 锐利的棱角)
- 创建了硬阴影工具类(有偏移、无模糊)
- 添加了自定义的按钮悬停效果,模拟阴影被「按下去」的样子
Step 3: HTML Structure (5 minutes)
搭建基础的 HTML 结构。打开 src/index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BoldTask - Project Management That Doesn't Suck</title>
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@400;500;700&display=swap" rel="stylesheet">
<!-- Tailwind CSS -->
<link rel="stylesheet" href="/src/styles.css">
</head>
<body>
<!-- Navigation -->
<nav class="border-b-4 border-brutal-black bg-brutal-white">
<div class="max-w-7xl mx-auto px-6 py-4 flex justify-between items-center">
<div class="text-2xl font-display">BoldTask</div>
<div class="hidden md:flex gap-8">
<a href="#features" class="font-bold hover:text-brutal-pink transition-colors">Features</a>
<a href="#pricing" class="font-bold hover:text-brutal-pink transition-colors">Pricing</a>
<a href="#about" class="font-bold hover:text-brutal-pink transition-colors">About</a>
</div>
<button class="bg-brutal-yellow border-brutal shadow-brutal px-6 py-2 font-bold uppercase btn-brutal">
Sign Up
</button>
</div>
</nav>
<!-- We'll add more sections here -->
<main>
<!-- Hero section will go here -->
<!-- Features section will go here -->
<!-- Pricing section will go here -->
<!-- Testimonial section will go here -->
</main>
<!-- Footer will go here -->
</body>
</html>Set Up Dev Server
我们需要一种方式来预览成果。用 Vite 吧:
把这段脚本加到你的 package.json:
{
"scripts": {
"dev": "vite src"
}
}现在运行:
在浏览器里打开 http://localhost:5173。你应该会看到一个带有 BoldTask 品牌名的基础导航栏。
Step 4: Build the Hero Section (10 minutes)
现在轮到重头戏了。主视觉区必须够大胆。
在 <main> 标签的紧后面加上这段:
<!-- Hero Section -->
<section class="bg-brutal-yellow min-h-screen flex items-center justify-center px-6 py-20">
<div class="max-w-6xl w-full">
<div class="grid md:grid-cols-2 gap-12 items-center">
<!-- Left Column - Text -->
<div>
<h1 class="font-display text-6xl md:text-8xl uppercase leading-none mb-6">
Task Management That Doesn't Bore You to Death
</h1>
<p class="text-xl md:text-2xl font-bold mb-8 bg-brutal-white border-brutal shadow-brutal-lg p-6">
Stop using the same gray dashboard as everyone else.
BoldTask gives you project management with personality.
</p>
<!-- CTA Buttons -->
<div class="flex flex-col sm:flex-row gap-4">
<button class="bg-brutal-black text-brutal-yellow border-brutal shadow-brutal-lg
px-8 py-4 font-bold text-lg uppercase btn-brutal">
Start Free Trial →
</button>
<button class="bg-brutal-white border-brutal shadow-brutal-lg
px-8 py-4 font-bold text-lg uppercase btn-brutal">
Watch Demo
</button>
</div>
<!-- Social Proof -->
<div class="mt-12 flex items-center gap-8">
<div class="text-center">
<div class="text-4xl font-display">10K+</div>
<div class="text-sm font-bold">Active Users</div>
</div>
<div class="h-12 w-1 bg-brutal-black"></div>
<div class="text-center">
<div class="text-4xl font-display">4.9★</div>
<div class="text-sm font-bold">User Rating</div>
</div>
<div class="h-12 w-1 bg-brutal-black"></div>
<div class="text-center">
<div class="text-4xl font-display">24/7</div>
<div class="text-sm font-bold">Support</div>
</div>
</div>
</div>
<!-- Right Column - Visual Element -->
<div class="relative">
<!-- Main Card -->
<div class="bg-brutal-white border-brutal-thick shadow-brutal-xl p-8 relative z-10">
<div class="bg-brutal-pink h-4 w-20 mb-4"></div>
<div class="h-3 bg-brutal-gray mb-2"></div>
<div class="h-3 bg-brutal-gray w-3/4 mb-6"></div>
<!-- Task Items -->
<div class="space-y-3">
<div class="flex items-center gap-3 p-3 bg-brutal-yellow border-brutal">
<div class="w-5 h-5 border-brutal bg-brutal-black"></div>
<div class="h-2 bg-brutal-black w-full"></div>
</div>
<div class="flex items-center gap-3 p-3 bg-brutal-white border-brutal">
<div class="w-5 h-5 border-brutal"></div>
<div class="h-2 bg-brutal-gray w-4/5"></div>
</div>
<div class="flex items-center gap-3 p-3 bg-brutal-white border-brutal">
<div class="w-5 h-5 border-brutal"></div>
<div class="h-2 bg-brutal-gray w-3/4"></div>
</div>
</div>
</div>
<!-- Floating accent card -->
<div class="absolute -bottom-8 -right-8 bg-brutal-cyan border-brutal-thick
shadow-brutal-lg p-6 w-40 text-center">
<div class="text-3xl font-display mb-2">+47</div>
<div class="text-xs font-bold">Tasks Done Today</div>
</div>
</div>
</div>
</div>
</section>我们做了什么:
- 全屏黄色背景(瞬间的冲击力)
- 用 Archivo Black 打造的巨型标题
- 带粗边框和硬阴影的内容框
- 带悬停效果的 CTA(悬停时阴影会移动)
- 展示信任度的数据
- 产品的可视化样机(抽象的表现形式)
- 制造纵深感的浮动点缀卡片
设计决策:
- 黄色背景 = 高能量、无法忽视
- 白色内容框 = 制造对比和层级
- 黄底上的黑色 CTA = 最大程度的可见性
- 浮动的青色卡片 = 加入非对称(新粗野主义的原则)
Step 5: Features Section (10 minutes)
我们来做功能卡片。在主视觉区后面加上这段:
<!-- Features Section -->
<section class="bg-brutal-white py-20 px-6">
<div class="max-w-7xl mx-auto">
<!-- Section Header -->
<div class="text-center mb-16">
<h2 class="font-display text-5xl md:text-7xl uppercase mb-6">
Why BoldTask?
</h2>
<p class="text-xl md:text-2xl font-bold max-w-3xl mx-auto">
Because your productivity tool shouldn't put you to sleep
</p>
</div>
<!-- Feature Grid -->
<div class="grid md:grid-cols-3 gap-8">
<!-- Feature 1 -->
<div class="bg-brutal-pink text-brutal-white border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">⚡</div>
<h3 class="font-display text-2xl uppercase mb-4">Lightning Fast</h3>
<p class="font-bold">
No lag. No loading. No waiting. Your tasks appear instantly
because we don't bloat our code with unnecessary animations.
</p>
</div>
<!-- Feature 2 -->
<div class="bg-brutal-cyan border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">🎨</div>
<h3 class="font-display text-2xl uppercase mb-4">Actually Unique</h3>
<p class="font-bold">
Tired of boring dashboards? We built something you'll actually
want to open. Bold colors, zero BS.
</p>
</div>
<!-- Feature 3 -->
<div class="bg-brutal-yellow border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">🔒</div>
<h3 class="font-display text-2xl uppercase mb-4">Privacy First</h3>
<p class="font-bold">
Your data stays yours. No tracking. No selling. No corporate
surveillance. Just your tasks, secured.
</p>
</div>
<!-- Feature 4 -->
<div class="bg-brutal-white border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">📱</div>
<h3 class="font-display text-2xl uppercase mb-4">Mobile Ready</h3>
<p class="font-bold">
Works on your phone, tablet, or desktop. Same bold design,
same fast performance everywhere.
</p>
</div>
<!-- Feature 5 -->
<div class="bg-brutal-white border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">🤝</div>
<h3 class="font-display text-2xl uppercase mb-4">Team Friendly</h3>
<p class="font-bold">
Invite your team. Assign tasks. Track progress. All without
the corporate bloat of "enterprise" tools.
</p>
</div>
<!-- Feature 6 -->
<div class="bg-brutal-white border-brutal-thick shadow-brutal-lg p-8
hover:-translate-y-2 transition-transform">
<div class="text-6xl font-display mb-4">💰</div>
<h3 class="font-display text-2xl uppercase mb-4">Fair Pricing</h3>
<p class="font-bold">
No hidden fees. No "contact sales." Just honest pricing that
makes sense. Pay for what you use.
</p>
</div>
</div>
</div>
</section>我们做了什么:
- 6 张功能卡片排在响应式网格里
- 用色块划分(粉、青、黄、白)制造视觉趣味
- 表情符号图标(简单、好玩、契合品牌)
- 悬停效果(悬停时卡片抬起)
- 一致的粗边框和硬阴影
设计模式: 注意到前三张卡片用了点缀色(粉、青、黄),而下面三张用白色了吗?这就制造出视觉层级——上排更吸引注意。
Step 6: Pricing Section (12 minutes)
定价表很关键。我们要让它无法被错过:
<!-- Pricing Section -->
<section id="pricing" class="bg-brutal-black text-brutal-white py-20 px-6">
<div class="max-w-7xl mx-auto">
<!-- Section Header -->
<div class="text-center mb-16">
<h2 class="font-display text-5xl md:text-7xl uppercase mb-6">
Simple Pricing
</h2>
<p class="text-xl md:text-2xl font-bold max-w-2xl mx-auto">
No tricks. No hidden costs. Just pick a plan and start shipping.
</p>
</div>
<!-- Pricing Grid -->
<div class="grid md:grid-cols-3 gap-8">
<!-- Free Plan -->
<div class="bg-brutal-white text-brutal-black border-brutal-thick shadow-brutal-lg p-8">
<div class="mb-6">
<div class="text-sm font-bold uppercase mb-2 text-gray-600">For Individuals</div>
<h3 class="font-display text-4xl uppercase mb-4">Free</h3>
<div class="text-5xl font-display mb-2">$0</div>
<div class="text-sm font-bold text-gray-600">Forever free</div>
</div>
<ul class="space-y-3 mb-8">
<li class="flex items-start gap-3">
<span class="text-brutal-yellow text-xl">✓</span>
<span class="font-bold">Up to 10 projects</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-yellow text-xl">✓</span>
<span class="font-bold">Unlimited tasks</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-yellow text-xl">✓</span>
<span class="font-bold">Mobile apps</span>
</li>
<li class="flex items-start gap-3">
<span class="text-gray-400 text-xl">✗</span>
<span class="font-bold text-gray-400">Team collaboration</span>
</li>
<li class="flex items-start gap-3">
<span class="text-gray-400 text-xl">✗</span>
<span class="font-bold text-gray-400">Priority support</span>
</li>
</ul>
<button class="w-full bg-brutal-white border-brutal shadow-brutal
px-6 py-3 font-bold uppercase btn-brutal">
Start Free
</button>
</div>
<!-- Pro Plan (Highlighted) -->
<div class="bg-brutal-yellow text-brutal-black border-brutal-thick shadow-brutal-xl p-8
relative transform md:-translate-y-4">
<!-- Popular Badge -->
<div class="absolute -top-4 left-1/2 -translate-x-1/2 bg-brutal-pink text-brutal-white
border-brutal px-6 py-2 font-bold uppercase text-sm">
Most Popular
</div>
<div class="mb-6 mt-4">
<div class="text-sm font-bold uppercase mb-2">For Professionals</div>
<h3 class="font-display text-4xl uppercase mb-4">Pro</h3>
<div class="text-5xl font-display mb-2">$12</div>
<div class="text-sm font-bold">Per month</div>
</div>
<ul class="space-y-3 mb-8">
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Unlimited projects</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Unlimited tasks</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Mobile apps</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Team collaboration (5 members)</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Priority support</span>
</li>
</ul>
<button class="w-full bg-brutal-black text-brutal-yellow border-brutal shadow-brutal-lg
px-6 py-3 font-bold uppercase btn-brutal">
Get Pro →
</button>
</div>
<!-- Team Plan -->
<div class="bg-brutal-cyan text-brutal-black border-brutal-thick shadow-brutal-lg p-8">
<div class="mb-6">
<div class="text-sm font-bold uppercase mb-2">For Teams</div>
<h3 class="font-display text-4xl uppercase mb-4">Team</h3>
<div class="text-5xl font-display mb-2">$29</div>
<div class="text-sm font-bold">Per month</div>
</div>
<ul class="space-y-3 mb-8">
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Everything in Pro</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Unlimited team members</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Advanced analytics</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">Custom integrations</span>
</li>
<li class="flex items-start gap-3">
<span class="text-brutal-black text-xl">✓</span>
<span class="font-bold">24/7 priority support</span>
</li>
</ul>
<button class="w-full bg-brutal-black text-brutal-cyan border-brutal shadow-brutal
px-6 py-3 font-bold uppercase btn-brutal">
Get Team
</button>
</div>
</div>
<!-- Money Back Guarantee -->
<div class="mt-16 text-center">
<div class="inline-block bg-brutal-yellow text-brutal-black border-brutal-thick
shadow-brutal-lg px-8 py-4 font-bold text-lg">
💰 30-Day Money Back Guarantee - No Questions Asked
</div>
</div>
</div>
</section>我们做了什么:
- 三个区分清晰的定价档位
- 用颜色编码(白 = 免费,黄 = 热门,青 = 高级)
- 中间的卡片抬高、放大(把注意力引向推荐方案)
- 在 Pro 方案上加了「Most Popular」徽章
- 用功能勾叉(✓ 和 ✗)保证清晰
- 用退款保证赢得信任
设计策略:
- 黑色背景让彩色卡片格外跳脱
- 中间卡片略微抬高,制造视觉层级
- CTA 位置统一,方便对比
- CTA 的颜色与卡片背景相呼应
Step 7: Testimonial Section (8 minutes)
社会认同很管用。我们来加上用户评价:
<!-- Testimonial Section -->
<section class="bg-brutal-gray py-20 px-6">
<div class="max-w-7xl mx-auto">
<!-- Section Header -->
<div class="text-center mb-16">
<h2 class="font-display text-5xl md:text-7xl uppercase mb-6">
People Love It
</h2>
<p class="text-xl md:text-2xl font-bold max-w-2xl mx-auto">
Don't take our word for it. Here's what actual users say.
</p>
</div>
<!-- Testimonials Grid -->
<div class="grid md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Testimonial 1 -->
<div class="bg-brutal-white border-brutal shadow-brutal-lg p-6">
<div class="text-brutal-yellow text-2xl mb-4">★★★★★</div>
<p class="font-bold mb-6 text-lg">
"Finally, a task manager that doesn't look like it was designed
by accountants. BoldTask actually makes me WANT to check my tasks."
</p>
<div class="flex items-center gap-3">
<div class="w-12 h-12 bg-brutal-pink border-brutal"></div>
<div>
<div class="font-bold">Sarah Chen</div>
<div class="text-sm text-gray-600">Product Designer</div>
</div>
</div>
</div>
<!-- Testimonial 2 -->
<div class="bg-brutal-white border-brutal shadow-brutal-lg p-6">
<div class="text-brutal-yellow text-2xl mb-4">★★★★★</div>
<p class="font-bold mb-6 text-lg">
"I switched from Asana and never looked back. BoldTask is faster,
cleaner, and way more fun to use. Plus it's actually affordable."
</p>
<div class="flex items-center gap-3">
<div class="w-12 h-12 bg-brutal-cyan border-brutal"></div>
<div>
<div class="font-bold">Marcus Rodriguez</div>
<div class="text-sm text-gray-600">Startup Founder</div>
</div>
</div>
</div>
<!-- Testimonial 3 -->
<div class="bg-brutal-white border-brutal shadow-brutal-lg p-6">
<div class="text-brutal-yellow text-2xl mb-4">★★★★★</div>
<p class="font-bold mb-6 text-lg">
"Our whole team uses it now. The bold design actually helps us
stay focused. Weird but true."
</p>
<div class="flex items-center gap-3">
<div class="w-12 h-12 bg-brutal-yellow border-brutal"></div>
<div>
<div class="font-bold">Priya Kapoor</div>
<div class="text-sm text-gray-600">Engineering Manager</div>
</div>
</div>
</div>
</div>
</div>
</section>我们做了什么:
- 三张风格统一的用户评价卡片
- 星级评分(黄 = 注意力)
- 用户头像(用抽象的彩色方块代替照片)
- 用姓名和头衔增加可信度
为什么用抽象头像? 真实照片可能显得太企业化。彩色方块能保持那份好玩的、几何化的新粗野主义美学。
Step 8: Footer (5 minutes)
每个网站都需要页脚。我们的这个要够大胆:
<!-- Footer -->
<footer class="bg-brutal-black text-brutal-white border-t-4 border-brutal-white py-12 px-6">
<div class="max-w-7xl mx-auto">
<div class="grid md:grid-cols-4 gap-12 mb-12">
<!-- Brand -->
<div>
<div class="font-display text-3xl mb-4">BoldTask</div>
<p class="font-bold text-gray-300">
Project management that doesn't suck.
</p>
</div>
<!-- Product Links -->
<div>
<h4 class="font-display text-lg uppercase mb-4">Product</h4>
<ul class="space-y-2">
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Features</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Pricing</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Roadmap</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Changelog</a></li>
</ul>
</div>
<!-- Company Links -->
<div>
<h4 class="font-display text-lg uppercase mb-4">Company</h4>
<ul class="space-y-2">
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">About</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Blog</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Careers</a></li>
<li><a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Contact</a></li>
</ul>
</div>
<!-- Newsletter -->
<div>
<h4 class="font-display text-lg uppercase mb-4">Stay Updated</h4>
<p class="font-bold mb-4 text-gray-300">Get updates about new features.</p>
<div class="flex gap-2">
<input
type="email"
placeholder="Your email"
class="flex-1 bg-brutal-white text-brutal-black border-brutal px-4 py-2
font-bold placeholder:text-gray-400"
/>
<button class="bg-brutal-yellow text-brutal-black border-brutal shadow-brutal
px-4 py-2 font-bold uppercase btn-brutal">
→
</button>
</div>
</div>
</div>
<!-- Bottom Bar -->
<div class="border-t-2 border-gray-700 pt-8 flex flex-col md:flex-row justify-between items-center gap-4">
<div class="font-bold text-gray-400">
© 2026 BoldTask. All rights reserved.
</div>
<div class="flex gap-6">
<a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Privacy</a>
<a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Terms</a>
<a href="#" class="font-bold hover:text-brutal-yellow transition-colors">Twitter</a>
<a href="#" class="font-bold hover:text-brutal-yellow transition-colors">GitHub</a>
</div>
</div>
</div>
</footer>我们做了什么:
- 四列式页脚布局
- 品牌、导航和邮件订阅
- 悬停效果(链接变黄)
- 带粗野样式的邮箱输入框
- 底部的版权栏
Step 9: Adding Polish and Interactions (5 minutes)
我们来加几处最后的润色,让网站显得更精致。
Smooth Scrolling
把这段加到你的 src/styles.css:
/* Smooth scrolling for anchor links */
html {
scroll-behavior: smooth;
}
/* Custom scrollbar (optional but on-brand) */
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: var(--color-brutal-gray);
}
::-webkit-scrollbar-thumb {
background: var(--color-brutal-black);
border: 2px solid var(--color-brutal-gray);
}
::-webkit-scrollbar-thumb:hover {
background: var(--color-brutal-yellow);
}Mobile Menu Toggle
把这段 JavaScript 加到闭合的 </body> 标签之前:
<script>
// Mobile menu toggle
const mobileMenuButton = document.createElement('button');
mobileMenuButton.className = 'md:hidden border-brutal bg-brutal-yellow px-4 py-2 font-bold';
mobileMenuButton.textContent = 'MENU';
const nav = document.querySelector('nav > div');
const navLinks = nav.querySelector('.hidden');
// This is a simple example - you'd want to make this more robust
mobileMenuButton.addEventListener('click', () => {
navLinks.classList.toggle('hidden');
navLinks.classList.toggle('flex');
});
// Add button to nav (you'd do this more elegantly in production)
</script>Performance Optimization
把这些 meta 标签加到你的 <head>:
<!-- Preload critical fonts -->
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@400;500;700&display=swap">
<!-- Meta tags for SEO and social -->
<meta name="description" content="BoldTask - Project management that doesn't suck. Bold design, fast performance, fair pricing.">
<meta property="og:title" content="BoldTask - Project Management That Doesn't Suck">
<meta property="og:description" content="Stop using boring task managers. BoldTask gives you project management with personality.">
<meta property="og:image" content="/og-image.png">
<meta name="twitter:card" content="summary_large_image">Step 10: Testing and Refinements (5 minutes)
现在来测试你的网站:
Responsive Testing
打开 DevTools(F12),测试这些断点:
- 移动端(375px)
- 平板(768px)
- 桌面端(1280px)
确认以下几点:
- 文字在所有尺寸下都可读
- 按钮在移动端可点按(至少 44px 高)
- 网格布局能正确折叠
- 阴影在小屏上不会被裁掉
Accessibility Check
过一遍这份清单:
- 所有交互元素都可用键盘访问(用 Tab 逐个走一遍页面)
- 色彩对比度符合 WCAG AA 标准(白底黑字 ✓,白底黄字 ✓)
- 图片有替代文本(我们用的是 div,但如果你加图片,记得加替代文本)
- 表单输入有标签
- 焦点状态可见
Performance Check
在 Chrome DevTools 里打开 Lighthouse 跑一次审计。你应该会看到:
- Performance: 90+(CSS 极简,没有沉重的框架)
- Accessibility: 90+(高对比、语义化 HTML)
- Best Practices: 90+
- SEO: 90+
如果分数偏低,常见的修复方法:
- 给图片加上
width和height - 生产环境里压缩 CSS
- 启用缓存头
- 压缩图片
Bonus: Converting to React/Next.js
想在 React 应用里用这套?下面是把主视觉区改写的方法:
// components/Hero.tsx
export default function Hero() {
return (
<section className="bg-brutal-yellow min-h-screen flex items-center justify-center px-6 py-20">
<div className="max-w-6xl w-full">
<div className="grid md:grid-cols-2 gap-12 items-center">
{/* Left Column */}
<div>
<h1 className="font-display text-6xl md:text-8xl uppercase leading-none mb-6">
Task Management That Doesn't Bore You to Death
</h1>
<p className="text-xl md:text-2xl font-bold mb-8 bg-brutal-white border-brutal shadow-brutal-lg p-6">
Stop using the same gray dashboard as everyone else.
BoldTask gives you project management with personality.
</p>
<div className="flex flex-col sm:flex-row gap-4">
<button className="bg-brutal-black text-brutal-yellow border-brutal shadow-brutal-lg
px-8 py-4 font-bold text-lg uppercase btn-brutal">
Start Free Trial →
</button>
<button className="bg-brutal-white border-brutal shadow-brutal-lg
px-8 py-4 font-bold text-lg uppercase btn-brutal">
Watch Demo
</button>
</div>
{/* Social Proof */}
<div className="mt-12 flex items-center gap-8">
<div className="text-center">
<div className="text-4xl font-display">10K+</div>
<div className="text-sm font-bold">Active Users</div>
</div>
<div className="h-12 w-1 bg-brutal-black"></div>
<div className="text-center">
<div className="text-4xl font-display">4.9★</div>
<div className="text-sm font-bold">User Rating</div>
</div>
</div>
</div>
{/* Right Column - Visual */}
<div className="relative">
<div className="bg-brutal-white border-brutal-thick shadow-brutal-xl p-8 relative z-10">
{/* Task mockup */}
<div className="bg-brutal-pink h-4 w-20 mb-4"></div>
<div className="h-3 bg-brutal-gray mb-2"></div>
<div className="h-3 bg-brutal-gray w-3/4 mb-6"></div>
<div className="space-y-3">
<div className="flex items-center gap-3 p-3 bg-brutal-yellow border-brutal">
<div className="w-5 h-5 border-brutal bg-brutal-black"></div>
<div className="h-2 bg-brutal-black w-full"></div>
</div>
<div className="flex items-center gap-3 p-3 bg-brutal-white border-brutal">
<div className="w-5 h-5 border-brutal"></div>
<div className="h-2 bg-brutal-gray w-4/5"></div>
</div>
</div>
</div>
<div className="absolute -bottom-8 -right-8 bg-brutal-cyan border-brutal-thick
shadow-brutal-lg p-6 w-40 text-center">
<div className="text-3xl font-display mb-2">+47</div>
<div className="text-xs font-bold">Tasks Done Today</div>
</div>
</div>
</div>
</div>
</section>
);
}然后在你的 tailwind.config.ts 里这样写:
import type { Config } from 'tailwindcss'
const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
fontFamily: {
sans: ['var(--font-space-grotesk)', 'sans-serif'],
display: ['var(--font-archivo-black)', 'sans-serif'],
},
colors: {
'brutal-yellow': '#ffdb33',
'brutal-pink': '#ff006e',
'brutal-cyan': '#00f0ff',
'brutal-black': '#000000',
'brutal-white': '#ffffff',
'brutal-gray': '#e5e5e5',
},
boxShadow: {
'brutal-sm': '2px 2px 0 0 #000',
'brutal': '4px 4px 0 0 #000',
'brutal-lg': '6px 6px 0 0 #000',
'brutal-xl': '8px 8px 0 0 #000',
},
borderWidth: {
'brutal': '4px',
'brutal-thick': '6px',
},
},
},
plugins: [],
}
export default configCommon Mistakes and How to Avoid Them
做了几十个新粗野主义网站之后,下面是我最常见到的几个坑:
1. Inconsistent Border Widths
错误: 有的元素用 2px 边框,有的用 5px,还有的地方用 3px。
对策: 挑定 2 到 3 种边框宽度(例如标准 3px、强调 4px、主要元素 6px),然后全程一致地使用。
2. Forgetting Mobile Shadow Offsets
错误: 移动端上 10px 的阴影偏移被裁掉,或者引发横向滚动。
对策: 使用响应式的阴影工具类:
.card {
box-shadow: 4px 4px 0 0 #000;
}
@media (min-width: 768px) {
.card {
box-shadow: 8px 8px 0 0 #000;
}
}3. Too Many Accent Colors
错误: 以为「越多越粗野」,用了 5 种以上的颜色。
对策: 坚持黑 + 白 + 最多 2 到 3 种点缀色。我们这套配色用了黄、粉、青——这已经是极限了。
4. Neglecting Accessibility
错误: 白背景上的黄字(读不清)、没有焦点状态、对比不足。
对策: 一定要测试对比度。黄底或白底上用黑字,黑底或深色背景上用白字。
5. Soft Shadows Sneaking In
错误: 不小心用了 Tailwind 的默认阴影(shadow-lg),带上了模糊。
对策: 自建阴影工具类,必要时禁用默认阴影。
Next Steps and Resources
恭喜!你刚刚从零打造出了一个完整的新粗野主义网站。
What to Do Next
1. Deploy It
# Build for production
npm run build
# Deploy to Vercel, Netlify, or wherever2. Add Functionality
- 把邮件订阅表单接到某个服务(ConvertKit、Mailchimp)
- 用 Stripe 实现定价的 CTA
- 加上分析工具(Plausible、Fathom)
3. Expand the Design System
- 做更多组件(弹窗、下拉菜单、提示框)
- 加更多页面(关于、博客、联系)
- 加上暗色模式(新粗野主义在暗色模式下也很出彩)
4. Optimize Further
- 压缩 CSS 和 HTML
- 加上图片优化
- 实现缓存策略
- 考虑用静态站点生成器换取更好的性能
Helpful Resources
Design Inspiration:
- Brutalist Websites - 精选合集
- Gumroad - 新粗野主义的正确示范
- Feastables - 好玩的新粗野主义电商
Tools:
- Neobrutalism - 现成的新粗野主义组件
- Tailwind CSS v4 Docs - 官方文档
- Google Fonts - 免费字体(Archivo Black、Space Grotesk)
Color Palette Generators:
- Coolors - 生成配色方案
- Adobe Color - 色环和配色工具
Final Thoughts
你在一小时之内,就把一个新粗野主义网站从零做到了部署上线。这真的很了不起。
要点总结:
- 新粗野主义 = 粗边框 + 硬阴影 + 大胆的色彩 + 零圆角
- Tailwind v4 的
@theme指令让定制更清爽 - 一致性至关重要(边框宽度、阴影、色彩)
- 无障碍依然重要(高对比很有帮助)
- 先搭好一套扎实的设计系统,再做组件
这个网站不只是个演示——它是一套你能拿去用在真实项目里的模板。换颜色、换字体、调阴影,让它成为你的。
新粗野主义最棒的地方是什么?它很宽容。不完美本就是这套美学的一部分。你那条稍微没对齐的边框,或者略微偏离中心的元素?那不是 bug,是味道。
现在,去做点大胆的东西吧,别再和别人的作品集/SaaS/落地页长得一模一样。
祝构建愉快。🚀
有疑问? 留个评论,或者到 Twitter 上找我。我很喜欢看大家用这套风格做出什么。
想要完整代码? 完整的 HTML 文件放在一个 GitHub Gist 里(链接在评论区)。
觉得有帮助? 把它分享给需要逃离无聊设计陷阱的开发者。