Best For
三栏 / 圣杯 / 经典
Holy Grail 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
三栏 / 圣杯 / 经典
Primary Move
Use CSS Grid or Flexbox for equal-height three columns
Watch Out
Do not allow unequal column heights
Showcase Entry
Live preview of the showcase page. Click to explore the full experience.
Color Palette
Primary
#1e293b
Secondary
#f1f5f9
Accent 1
#3b82f6
Accent 2
#10b981
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 correctlyComponent 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
/* 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
圣杯布局 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.