Design System Documentation

Saheb Ansari Blog - Version 2.0

Overview

This document outlines the comprehensive visual design system implemented for the Saheb Ansari blog. The design system provides a cohesive, modern, and accessible user interface built on a solid foundation of design tokens.


πŸ“ Design Tokens

Color Palette

Primary Brand Colors (Blue)

Secondary Brand Colors (Purple)

Accent Colors

Neutral Gray Scale (12-step)

Full range from --color-gray-50 (#fafafa) to --color-gray-950 (#0a0a0a) for backgrounds, text, borders.

Semantic Colors

Typography

Font Families

Type Scale (using 4px baseline grid)

Font Weights

Line Heights

Spacing Scale (4px baseline)

Border Radius

Shadows

Transitions

Z-Index Scale


🧩 Components

Navigation Bar

Implementation: <nav class="navbar">

Hero Section

Implementation: <section class="hero">

Buttons

Base class: .btn

Variants:

Sizes:

States:

Post Cards

Structure:

<a href="..." class="post-card">
  <div class="post-card-image-wrapper">
    <img class="post-card-image" ...>
  </div>
  <div class="post-card-content">
    <div class="post-card-header">
      <span class="post-card-tag">Category</span>
      <h3 class="post-card-title">Title</h3>
    </div>
    <p class="post-card-excerpt">Excerpt...</p>
    <div class="post-card-footer">
      <span class="post-card-date">Date</span>
      <span class="post-card-readtime">Time</span>
    </div>
  </div>
</a>

Features:

Article/Post Page

Header:

Content:

Share Buttons:

Footer

Progress Indicators


🎨 Dark Mode

Dark mode inverts colors intelligently:

Activation: Toggle button in navbar, persists in localStorage, respects system preference.


β™Ώ Accessibility Features


πŸ“± Responsive Breakpoints


πŸš€ Performance Optimizations


πŸ“¦ File Structure

src/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ fluent2-tokens.css    ← Design system tokens
β”‚   β”‚   └── style.css              ← Component styles & utilities
β”‚   └── js/
β”‚       └── theme.js               ← Dark mode toggle
β”œβ”€β”€ _includes/
β”‚   └── layouts/
β”‚       β”œβ”€β”€ base.njk               ← Main template
β”‚       └── post.njk               ← Article template
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ blog.njk                   ← Blog listing
β”‚   β”œβ”€β”€ about.njk                  ← About page
β”‚   └── ... (legal pages)
└── _includes/
    └── post-card.njk              ← Reusable post card

🎯 Usage Guidelines

Adding New Pages

  1. Create .njk file in src/pages/ or appropriate location
  2. Use layout: base frontmatter
  3. Set title, description, pageType
  4. Use semantic HTML with utility classes from design system

Styling New Components

  1. Use CSS custom properties (var(--*))
  2. Follow naming conventions: component-name, component--modifier, component__element
  3. Add hover, focus, and active states
  4. Test in both light and dark modes
  5. Ensure mobile responsiveness

Adding Blog Posts


πŸ”„ Migration from Old System

Mapping Old Classes β†’ New

Old Class New Class
fluent-body fluent-body (kept for transition)
fluent-nav navbar
fluent-hero hero
fluent-button btn + btn--primary/secondary
fluent-post-card post-card
fluent-section section
fluent-footer footer
fluent-container container

Removed Redundancies


πŸ› Browser Support

Note: Uses CSS features like color-mix() which requires modern browsers. Consider fallbacks for older browsers if needed.


πŸ“š Resources


πŸŽ‰ Conclusion

This design system provides a solid foundation for a modern, accessible, and maintainable website. All components are built with consistency, scalability, and user experience in mind.

Version: 2.0 Last Updated: May 2026 Maintained By: Saheb Ansari