Comprehensive styling guide emphasizing Tailwind CSS utility-first approach with wedding-themed design system.
Reference: CONST-P7 (Design System & UI Excellence), CONST-P14 (User Experience Excellence), CONST-P15 (Wedding Theme Integration)
This guide establishes how to manage styling in our wedding RSVP project, ensuring consistency, maintainability, and performance while creating a beautiful, celebratory user experience.
Our tailwind.config.js
defines the wedding design system:
// Wedding Theme Configuration
theme: {
extend: {
colors: {
// Wedding Color Palette
primary: {
50: '#fdf7f0', // Champagne light
100: '#f7e6d1', // Champagne
500: '#d4af37', // Gold
600: '#b8941f', // Dark gold
900: '#8b6914' // Deep gold
},
blush: {
50: '#fef7f7', // Soft blush
100: '#fce8e6', // Light blush
200: '#f7cdc8', // Blush
300: '#f1a7a0' // Deep blush
},
sage: {
50: '#f7f9f7', // Light sage
100: '#e8f2e8', // Sage green
200: '#c8dcc8', // Medium sage
300: '#a3c4a3' // Deep sage
}
},
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'], // Body text
serif: ['Playfair Display', 'Georgia', 'serif'] // Headings
}
}
}
Semantic Color Usage:
Color Application Rules:
text-primary-600
, bg-blush-50
)bg-red-500
with bg-green-500
)Font Hierarchy:
/* Headings - Playfair Display (serif) */
.heading-display /* text-5xl font-serif font-bold */
.heading-1 /* text-4xl font-serif font-bold */
.heading-2 /* text-3xl font-serif font-semibold */
.heading-3 /* text-2xl font-serif font-semibold */
/* Body - Inter (sans) */
.body-large /* text-lg font-sans */
.body-base /* text-base font-sans */
.body-small /* text-sm font-sans */
.caption /* text-xs font-sans text-gray-600 */
Usage Guidelines:
Spacing Scale (multiples of 4px):
space-1
= 4px (tight spacing)space-2
= 8px (small spacing)space-4
= 16px (base spacing)space-6
= 24px (medium spacing)space-8
= 32px (large spacing)space-12
= 48px (extra large spacing)Layout Patterns:
/* Card Container */
.wedding-card {
@apply bg-white rounded-xl shadow-lg p-6 border border-blush-100;
}
/* Section Spacing */
.section-spacing {
@apply py-12 px-4;
}
/* Container Widths */
.container-sm { @apply max-w-2xl mx-auto; }
.container-md { @apply max-w-4xl mx-auto; }
.container-lg { @apply max-w-6xl mx-auto; }
Breakpoint Strategy:
Implementation Pattern:
// Mobile-first responsive design
<div className="
grid grid-cols-1 gap-4 // Mobile: single column
sm:grid-cols-2 // Small screens: 2 columns
lg:grid-cols-3 // Large screens: 3 columns
xl:gap-6 // Extra large: bigger gaps
">
Class Grouping Pattern:
// Group by concern for readability
<button className="
// Layout & Sizing
px-6 py-3 rounded-lg
// Typography
font-medium text-base
// Colors & States
bg-primary-500 text-white
hover:bg-primary-600 focus:bg-primary-700
// Transitions
transition-colors duration-200
">
RSVP Now
</button>
Class Ordering (via ESLint plugin):
When to Use CSS Modules:
File Structure:
src/
├── shared/
│ ├── components/
│ │ ├── WeddingCard/
│ │ │ ├── WeddingCard.tsx
│ │ │ ├── WeddingCard.module.css // Only when needed
│ │ │ └── index.ts
Standardized Component Styles:
// Wedding Button Variants
const buttonVariants = {
primary: "bg-primary-500 hover:bg-primary-600 text-white",
secondary: "bg-blush-100 hover:bg-blush-200 text-primary-700",
ghost: "bg-transparent hover:bg-blush-50 text-primary-600"
}
// Wedding Card Styles
const cardVariants = {
elegant: "bg-white border border-blush-100 shadow-lg rounded-xl",
romantic: "bg-gradient-to-br from-blush-50 to-white border border-blush-200",
modern: "bg-white shadow-xl rounded-2xl border-0"
}
// Proper focus management
<button className="
focus:outline-none
focus-visible:ring-2
focus-visible:ring-primary-500
focus-visible:ring-offset-2
">
{children}
</button>
clsx
or cn
utility for conditional classes// Optimized image loading
import Image from 'next/image'
<Image
src="/wedding-hero.jpg"
alt="Beautiful wedding ceremony"
width={800}
height={600}
priority={true} // For hero images
placeholder="blur" // Show blur while loading
className="rounded-lg object-cover"
/>
{
"extends": ["plugin:@tailwindcss/recommended"],
"rules": {
"@tailwindcss/classnames-order": "error",
"@tailwindcss/no-contradicting-classname": "error",
"@tailwindcss/no-unnecessary-arbitrary-value": "error"
}
}
// Subtle, celebratory animations
<div className="
transform transition-all duration-300 ease-in-out
hover:scale-105 hover:shadow-xl
hover:-translate-y-1
">
{/* Wedding content */}
</div>
rounded-lg
or rounded-xl
for warmthshadow-lg
for depth without harshnessThese styling guidelines ensure our wedding RSVP app delivers a beautiful, accessible, and performant user experience that celebrates love and creates joy for every guest.