Best For
holy grail layout / three column layout / classic web layout
The classic three-column web layout consisting of a fixed header, a three-column middle section (left navigation, main content, right sidebar), and a fixed footer -- a foundational layout paradigm in web design.
Best For
holy grail layout / three column layout / classic web layout
Primary Move
Use CSS Grid or Flexbox for equal-height three columns
Watch Out
Do not allow unequal column heights
AI Implementation
Use the Hard Prompt by default to generate UI. Use the Design Spec to understand, modify, and review the style. Use the Creative Brief for early exploration.
Use this by default: copy it, append the concrete requirement, and let AI generate consistent production UI.
When to use
How to use
STYLEKIT_STYLE_REFERENCE
style_name: Holy Grail Layout
style_slug: holy-grail-layout
style_source: /styles/holy-grail-layout
# Hard Prompt
## When To Use
Use this when you want AI to generate code with strict style consistency. It is the safest default for production UI.
## How To Use
- Copy the full prompt into ChatGPT, Claude, Cursor, or another coding assistant.
- Append the concrete product/page requirement after the prompt.
- After generation, check the forbidden rules and interaction states before accepting the output.
Strictly follow the style rules below and maintain consistency. No style drift allowed.
## Requirements
- Prioritize style consistency first, then creative extension.
- When conflicts arise, treat prohibitions as the highest priority.
- Self-check before output: verify colors, typography, spacing, and interactions still match this style.
## Style Rules
You are a Holy Grail Layout expert. All generated code must strictly follow these constraints:
## Layout Structure
Five regions:
1. Header: Fixed top, brand + navigation
2. Left Sidebar: Fixed width, navigation menu
3. Main Content: Fluid width, primary content
4. Right Sidebar: Fixed width, auxiliary information
5. Footer: Fixed bottom, copyright information
## Implementation Rules
- Use Flexbox: outer flex flex-col min-h-screen
- Three-column area: flex flex-1
- Sidebars: fixed width w-60 / w-64 flex-shrink-0
- Main content: flex-1 min-w-0
- Header: sticky top-0 z-50
- Equal-height columns: three columns auto equal height
## Responsive
Large screens (>1024px): Full three columns
Medium screens (768-1024px): Hide right sidebar
Small screens (<768px): All columns stack vertically
## Animation & Interaction Rules
### Content Supremacy (Card Float)
- Cards in main content: hover:-translate-y-0.5 hover:shadow-md -- minimal, non-distracting float
- NEVER use hover:-translate-y-2 or larger (breaks reading focus)
- Transition: duration-150 ease-out (crisp productivity tool rhythm)
### Navigation Anchoring (Sidebar Links)
- Inactive nav items: hover:border-l-2 hover:border-[#3b82f6] hover:bg-gray-50 -- left-border highlight ONLY
- NEVER add vertical displacement to sidebar nav (anchoring feel requires stability)
- Active item: bg-[#3b82f6]/10 text-[#3b82f6] -- always-visible active state
### Crisp Performance (Duration Standard)
- All transitions: duration-150 ease-out -- productivity tools must feel instant
- NEVER exceed duration-200 for any interactive element
### Button Physics
- Hover: hover:-translate-y-0.5 hover:shadow-[0_4px_10px_rgba(59,130,246,0.4)]
- Active: active:scale-[0.98] active:translate-y-0 active:shadow-none -- tactile micropress
- Focus: focus:ring-2 focus:ring-[#3b82f6] focus:ring-offset-2 (WCAG 2.1 AA)
## Self-check
1. Header fixed at top
2. Three columns equal height
3. Main content area is fluid
4. Sidebars have fixed width
5. Footer always at bottom
6. Responsive collapsing works correctly
---
# Holy Grail Layout Design System
> The classic three-column web layout consisting of a fixed header, a three-column middle section (left navigation, main content, right sidebar), and a fixed footer -- a foundational layout paradigm in web design.
## Design Philosophy
Holy Grail Layout is the long-sought classic layout solution in web design, featuring a fixed header and footer with a three-column content area in between. The name originates from the difficulty of implementing this layout in the early days of CSS.
Core principles:
- Clear structure: Header, three-column content, and footer -- five regions each serving a distinct purpose
- Content-first: Main content precedes sidebars in HTML source for better SEO
- Equal-height columns: All three columns maintain equal height regardless of content
- Flexible adaptation: Sidebars have fixed widths while the main content area is fluid
---
## Token Dictionary (exact class mapping)
### Border
```
Width: border
Color: border-gray-200
Radius: rounded-xl
```
### Shadow
```
sm: shadow-sm
md: shadow-sm
lg: shadow-md
hover: hover:shadow-md
focus: focus:shadow-sm
```
### Interaction
```
Hover translate: (none)
Hover scale: (none)
Hover opacity: hover:opacity-90
Transition: transition-colors duration-200
Active: active:scale-95
```
### Typefaces
```
Heading: font-semibold tracking-tight
Body: font-sans
Mono: font-mono
```
### Type scale
```
Hero: text-2xl md:text-3xl
H1: text-xl md:text-2xl
H2: text-lg md:text-xl
H3: text-base md:text-lg
Body: text-sm md:text-base
Small: text-xs
```
### Spacing
```
Section: py-4 md:py-6
Container: px-4 md:px-6
Card: p-4 md:p-6
Gap sm: gap-2 md:gap-3
Gap md: gap-3 md:gap-4
Gap lg: gap-4 md:gap-6
```
### Color roles
```
Background primary: bg-[#f1f5f9]
Background secondary: bg-white
Background accent: bg-[#3b82f6], bg-[#10b981], bg-[#f59e0b], bg-[#ef4444]
Text primary: text-[#1e293b]
Text secondary: text-gray-600
Text muted: text-gray-400
Button primary: bg-[#3b82f6] text-white
Button secondary: bg-gray-100 text-gray-700
```
---
## [FORBIDDEN]
These classes are banned in this style. Check for them before returning code:
### Banned classes
- `rounded-none`
- `shadow-2xl`
- `font-black`
- `font-extrabold`
- `text-5xl`
- `text-6xl`
- `text-7xl`
- `text-8xl`
### Banned patterns
- matches `^rounded-none$`
- matches `^shadow-2xl`
- matches `^text-[5-8]xl`
### Why they are banned
- `rounded-none`: Holy Grail Layout uses moderate rounding (rounded-xl) for a professional look
- `shadow-2xl`: Holy Grail Layout uses subtle shadows befitting a standard web layout
- `text-6xl`: Holy Grail Layout uses moderate type sizes for balanced three-column reading
> WARNING: if your code contains any of the above, replace it before shipping.
---
## [REQUIRED]
### Every button must include
```
rounded-lg
font-medium text-sm
transition-colors
```
### Every card must include
```
bg-white
rounded-xl
shadow-sm
border border-gray-100
```
### Every input must include
```
bg-gray-50
border border-gray-200
rounded-lg
text-sm
focus:outline-none
focus:ring-2 focus:ring-[#3b82f6]/20 focus:border-[#3b82f6]
transition-all
```
---
## [COMPARE] Holy Grail Layout wrong vs right
The wrong examples below stand for generic library defaults that were never adapted to this style. Do not read them as visual suggestions.
### Button
[WRONG] **Wrong** (generic component library default, do not copy):
```html
<button class="{GENERIC_LIBRARY_BUTTON_DEFAULT}">
Click me
</button>
```
[CORRECT] **Right** (uses this style's tokens):
```html
<button class="rounded-lg font-medium text-sm transition-colors bg-[#3b82f6] text-white">
Click me
</button>
```
### Card
[WRONG] **Wrong** (generic card, not adapted to this style):
```html
<div class="{GENERIC_LIBRARY_CARD_DEFAULT}">
<h3>{TITLE}</h3>
</div>
```
[CORRECT] **Right** (uses this style's card tokens):
```html
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 md:p-6">
<h3 class="font-semibold tracking-tight text-base md:text-lg">{TITLE}</h3>
</div>
```
### Input
[WRONG] **Wrong** (generic input, not adapted to this style):
```html
<input class="{GENERIC_LIBRARY_INPUT_DEFAULT}" />
```
[CORRECT] **Right** (uses this style's input tokens):
```html
<input class="bg-gray-50 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[#3b82f6]/20 focus:border-[#3b82f6] transition-all" placeholder="{PLACEHOLDER}" />
```
---
## [TEMPLATES] Holy Grail Layout page skeletons
These skeletons use this style's tokens only. Replace `{PLACEHOLDER}` values, but keep every token in place:
### Navigation
```html
<nav class="bg-[#f1f5f9] text-[#1e293b] border border-gray-200 px-4 md:px-6">
<div class="flex items-center justify-between max-w-6xl mx-auto gap-3 md:gap-4">
<a href="/" class="font-semibold tracking-tight text-base md:text-lg">
{LOGO_TEXT}
</a>
<div class="flex gap-3 md:gap-4 font-sans text-xs">
{NAV_LINKS}
</div>
</div>
</nav>
```
### Hero section
```html
<section class="bg-[#3b82f6] text-[#1e293b] py-4 md:py-6 px-4 md:px-6">
<div class="max-w-4xl mx-auto">
<h1 class="font-semibold tracking-tight text-2xl md:text-3xl">
{HEADLINE}
</h1>
<p class="font-sans text-sm md:text-base max-w-xl">
{SUBHEADLINE}
</p>
<button class="rounded-lg font-medium text-sm transition-colors bg-[#3b82f6] text-white">
{CTA_TEXT}
</button>
</div>
</section>
```
### Card grid
```html
<section class="bg-[#f1f5f9] text-[#1e293b] py-4 md:py-6 px-4 md:px-6">
<div class="max-w-6xl mx-auto">
<h2 class="font-semibold tracking-tight text-lg md:text-xl">{SECTION_TITLE}</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3 md:gap-4">
<!-- Card template - repeat for each card -->
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 md:p-6">
<h3 class="font-semibold tracking-tight text-base md:text-lg">{CARD_TITLE}</h3>
<p class="font-sans text-sm md:text-base text-gray-400">{CARD_DESCRIPTION}</p>
</div>
</div>
</div>
</section>
```
### Form input
```html
<input class="bg-gray-50 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[#3b82f6]/20 focus:border-[#3b82f6] transition-all" placeholder="{PLACEHOLDER}" />
```
### Footer
```html
<footer class="bg-white text-gray-600 py-4 md:py-6 px-4 md:px-6">
<div class="max-w-6xl mx-auto">
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-6">
<div>
<span class="font-semibold tracking-tight text-base md:text-lg">{LOGO_TEXT}</span>
<p class="font-sans text-xs">{TAGLINE}</p>
</div>
<div>
<h4 class="font-semibold tracking-tight text-base md:text-lg">{COLUMN_TITLE}</h4>
<ul class="font-sans text-xs">
{FOOTER_LINKS}
</ul>
</div>
</div>
</div>
</footer>
```
---
## [CHECKLIST] Holy Grail Layout post-generation self check
**Before returning code, verify every token and rule below. Fix any violation before delivering:**
### Token check
- [ ] Button includes: `rounded-lg font-medium text-sm transition-colors`
- [ ] Card includes: `bg-white rounded-xl shadow-sm border border-gray-100`
- [ ] Input includes: `bg-gray-50 border border-gray-200 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[#3b82f6]/20 focus:border-[#3b82f6] transition-all`
### Forbidden check
- [ ] Not using `rounded-none`
- [ ] Not using `shadow-2xl`
- [ ] Not using `font-black`
- [ ] Not using `font-extrabold`
- [ ] Not using `text-5xl`
- [ ] Not using `text-6xl`
- [ ] Not using `text-7xl`
- [ ] Not using `text-8xl`
### Style rule check
- [ ] Use CSS Grid or Flexbox for equal-height three columns
- [ ] Sticky header and footer with sticky top-0 / sticky bottom-0
- [ ] Main content area uses flex-1 for fluid width
- [ ] Left navigation bar with fixed width w-60 or w-64
- [ ] Right sidebar with fixed width w-64 or w-72
### Style drift check
- [ ] Does not violate: Do not allow unequal column heights
- [ ] Does not violate: Do not make the main content area too narrow
- [ ] Does not violate: Do not ignore responsive collapsing
- [ ] Does not violate: Do not let sidebar width change with content
- [ ] Does not violate: Do not leave header and footer unfixed
### Delivery check
- [ ] Responsive layout holds on phone, tablet and desktop with no horizontal overflow
- [ ] Every interactive element has a visible focus state, an accessible name and a reduced-motion path
- [ ] Text contrast meets WCAG AA and colour alone never carries state
- [ ] The result is still recognizable at a glance as Holy Grail Layout
## Absolute Bans (Match and Refuse)
If any of the following patterns appear, it is a style violation — rewrite without exception.
- allow unequal column heights
- make the main content area too narrow
- ignore responsive collapsing
- let sidebar width change with content
- leave header and footer unfixed
- use large displacement animations on cards (large motion disrupts focus in reading contexts)
- use animation duration exceeding 200ms (productivity tools should feel crisp)
- omit active:scale-[0.98] on buttons (no tactile confirmation)
## Self-Check (Verify Before Shipping)
If any item fails, the style has drifted — fix before shipping.
- [ ] No purple-to-blue gradients
- [ ] No overused fonts (Inter, Roboto, Geist, Fraunces, Plus Jakarta Sans)
- [ ] No nested cards (cards inside cards)
- [ ] No gray text on colored backgrounds
- [ ] Body text contrast meets WCAG AA (>= 4.5:1)
- [ ] No bounce or elastic easing curves
- [ ] Animations have a prefers-reduced-motion fallback
- [ ] Body text line length capped at 65-75 characters
- [ ] No side-stripe accent borders (border-left/right > 1px)
- [ ] No gradient text (background-clip: text)
- [ ] No glassmorphism used as the default surface treatment
- [ ] No tiny uppercase tracked eyebrow labels above every section heading
- [ ] do not allow unequal column heights
- [ ] do not make the main content area too narrow
- [ ] do not ignore responsive collapsing
- [ ] do not let sidebar width change with content
- [ ] do not leave header and footer unfixedMore prompt libraries: All UI Prompts · Tailwind UI Prompts · Dark Mode UI Prompts
Component Templates
圣杯布局三态按钮:hover:-translate-y-0.5 轻量浮起,active:scale-[0.98] 触觉按压,focus:ring-2 WCAG 焦点环,duration-150 crisp 响应
Frontend Readiness
This layer tracks whether the style is ready for real websites: theme modes, state feedback, keyboard access, and performance constraints.
Overall
51%
Fallback
Dark Mode
0%
MissingUI States
79%
PartialMotion
70%
PartialA11y
70%
PartialPerformance
35%
FallbackButton
Default / Hover / Focus Visible / Active / Disabled
Input
Default / Hover / Focus Visible / Disabled / Error
Card
Default / Hover / Focus Visible / Loading / Skeleton
Form
Default / Focus Visible / Disabled / Loading / Error
FAQ
/* Holy Grail Layout 全局样式 */
/* 圣杯布局容器 */
.holy-grail {
display: flex;
flex-direction: column;
min-height: 100vh;
}
/* 页头 */
.holy-grail-header {
position: sticky;
top: 0;
z-index: 50;
background: white;
border-bottom: 1px solid #e2e8f0;
}
/* 三列主体 */
.holy-grail-body {
display: flex;
flex: 1;
}
/* 左侧导航栏 */
.holy-grail-nav {
width: 240px;
flex-shrink: 0;
background: white;
border-right: 1px solid #e2e8f0;
padding: 1rem;
}
/* 主内容区 */
.holy-grail-main {
flex: 1;
padding: 1.5rem;
min-width: 0;
}
/* 右侧边栏 */
.holy-grail-aside {
width: 256px;
flex-shrink: 0;
background: white;
border-left: 1px solid #e2e8f0;
padding: 1rem;
}
/* 页脚 */
.holy-grail-footer {
background: white;
border-top: 1px solid #e2e8f0;
padding: 1rem 1.5rem;
text-align: center;
}
/* 响应式 */
@media (max-width: 1024px) {
.holy-grail-aside {
display: none;
}
}
@media (max-width: 768px) {
.holy-grail-body {
flex-direction: column;
}
.holy-grail-nav {
width: 100%;
border-right: none;
border-bottom: 1px solid #e2e8f0;
}
}
/* Holy Grail Layout Design Tokens */
:root {
--holy-grail-layout-primary: #1e293b;
--holy-grail-layout-secondary: #f1f5f9;
--holy-grail-layout-accent: #3b82f6;
--holy-grail-layout-glow: rgba(30, 41, 59, 0.3);
}
@keyframes holy-grail-layout-fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes holy-grail-layout-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.holy-grail-layout-card {
position: relative;
overflow: hidden;
}
.holy-grail-layout-card::before {
content: "";
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.3s ease;
background: linear-gradient(135deg, rgba(30, 41, 59, 0.05), transparent);
pointer-events: none;
}
.holy-grail-layout-card:hover::before {
opacity: 1;
}
.holy-grail-layout-gradient {
background: linear-gradient(135deg, #1e293b, #3b82f6);
}
.holy-grail-layout-gradient-text {
background: linear-gradient(135deg, #1e293b, #3b82f6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.holy-grail-layout-frosted {
backdrop-filter: blur(12px) saturate(180%);
-webkit-backdrop-filter: blur(12px) saturate(180%);
background: rgba(30, 41, 59, 0.08);
}
.holy-grail-layout-accent-corner {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}
.holy-grail-layout-animate-in {
animation: holy-grail-layout-fade-in 0.5s ease-out both;
}Compatible Visual Styles
Holy Grail Layout is a layout pattern that can be paired with the following visual styles.
IDE Integration
Download configuration files for AI coding assistants to generate code in this style.
Style Pack
Get complete machine-readable style assets including design tokens, Tailwind presets, CSS variables, and shadcn/ui themes.
Metadata
Style metadata including version information
Design Tokens
Compatible with Figma / Style Dictionary / Tokens Studio
Tailwind Preset
Tailwind CSS theme preset, import directly in config
Global CSS
CSS variables and base styles
shadcn Theme
shadcn/ui theme configuration
CSS Variables
Pure CSS variables, works with any project
SKILL.md
Loadable skill pack for Cursor / Claude Code / VS Code
Holy Grail Layout is the long-sought classic layout solution in web design, featuring a fixed header and footer with a three-column content area in between. The name originates from the difficulty of implementing this layout in the early days of CSS.
WCAG 2.1 compliance analysis based on color contrast and typography readability.
Overall Score
Grade: D - Poor
Contrast Ratios
| Context | Colors | Ratio | AA | AAA |
|---|---|---|---|---|
| Text on background | /#1e293b / #f1f5f9 | 13.35:1 | ||
| Secondary text on background | /#4b5563 / #f1f5f9 | 6.9:1 | ||
| Muted text on background | /#9ca3af / #f1f5f9 | 2.32:1 | ||
| Text on secondary background | /#1e293b / #ffffff | 14.63:1 | ||
| Secondary text on secondary | /#4b5563 / #ffffff | 7.56:1 | ||
| Button primary | /#ffffff / #3b82f6 | 3.68:1 | ||
| Text on accent 1 | /#1e293b / #3b82f6 | 3.98:1 | ||
| Alt text on accent 1 | /#4b5563 / #3b82f6 | 2.05:1 | ||
| Text on accent 2 | /#1e293b / #10b981 | 5.77:1 | ||
| Alt text on accent 2 | /#4b5563 / #10b981 | 2.98:1 | ||
| Text on accent 3 | /#1e293b / #f59e0b | 6.81:1 | ||
| Alt text on accent 3 | /#4b5563 / #f59e0b | 3.52:1 | ||
| Text on accent 4 | /#1e293b / #ef4444 | 3.89:1 | ||
| Alt text on accent 4 | /#4b5563 / #ef4444 | 2.01:1 |
Readability
Score
68/100
Font Size
text-sm md:text-base
Font Weight
font-semibold tracking-tight
Line Height
default
Scoring is based on WCAG 2.1 standards. AA requires 4.5:1 contrast for normal text, 3:1 for large text; AAA requires 7:1 for normal text, 4.5:1 for large text.
Design Recipes
These curated recipes combine this style with layouts and animations, optimized for specific use cases.