Writing Page Layout Fix

🎯 Problem Identified

The /writing/ page layout was broken after our performance optimizations. The issue was that category-specific styling was missing for text-only posts (posts without featured images).

🔍 Root Cause

When posts don't have featured images, the writing-grid component applies category-based CSS classes like:

  • class="card feature-post category-writing"
  • class="card feature-post category-design"
  • etc.

However, there was no CSS styling for these category classes, so text-only writing posts had no visual distinction or proper backgrounds.

✅ Simple Solution Applied

Added Category-Specific Styling

Writing Posts (blue theme):

.feature-post.category-writing {
    background: linear-gradient(135deg, 
        rgba(100, 150, 255, 0.05) 0%, 
        rgba(100, 150, 255, 0.02) 100%) !important;
    border-left: 3px solid rgba(100, 150, 255, 0.3);
}

Design Posts (orange theme):

.feature-post.category-design {
    background: linear-gradient(135deg, 
        rgba(255, 150, 100, 0.05) 0%, 
        rgba(255, 150, 100, 0.02) 100%) !important;
    border-left: 3px solid rgba(255, 150, 100, 0.3);
}

Tools Posts (green theme):

.feature-post.category-tools {
    background: linear-gradient(135deg, 
        rgba(150, 255, 100, 0.05) 0%, 
        rgba(150, 255, 100, 0.02) 100%) !important;
    border-left: 3px solid rgba(150, 255, 100, 0.3);
}

Development Posts (pink theme):

.feature-post.category-development {
    background: linear-gradient(135deg, 
        rgba(255, 100, 150, 0.05) 0%, 
        rgba(255, 100, 150, 0.02) 100%) !important;
    border-left: 3px solid rgba(255, 100, 150, 0.3);
}

Fallback for other categories:

.feature-post[class*="category-"]:not(.category-writing):not(.category-design):not(.category-tools):not(.category-development) {
    background: linear-gradient(135deg, 
        rgba(200, 200, 200, 0.05) 0%, 
        rgba(200, 200, 200, 0.02) 100%) !important;
    border-left: 3px solid rgba(200, 200, 200, 0.3);
}

🎨 Visual Design

Features:

  • Subtle gradient backgrounds - Very light, not overwhelming
  • Colored left borders - Clear category identification
  • Color-coded system - Each category has its distinct color
  • Minimal and clean - Keeps the focus on content
  • Performance-optimized - CSS-only, no JavaScript

Color Palette:

  • 🔵 Writing: Soft blue tones
  • 🟠 Design: Warm orange tones
  • 🟢 Tools: Fresh green tones
  • 🟣 Development: Vibrant pink tones
  • Others: Neutral gray tones

📁 Files Updated

  1. _includes/writing-grid.html
    • Added category-specific CSS styling
    • Maintained performance optimizations
    • Added fallback for unknown categories

🎯 Results

The /writing/ page now has:

  • Proper category visualization with color-coded backgrounds
  • Clean, simplified styling that's easy to maintain
  • Performance-optimized CSS-only approach
  • Consistent with overall design language
  • Backward compatible with any category

The writing page should now look properly styled with subtle but clear category distinctions! 🎉