360TFT CSS Architecture Documentation

Modular CSS Structure

The 360TFT website uses a modular CSS architecture to maintain code organization, eliminate duplication, and improve performance. All styles are now organized into three main files:

Core CSS Files

1. base.css (1.5KB)

Purpose: Foundation styles and reset Contains:

2. components.css (13KB)

Purpose: All component-specific styles Contains:

3. utilities.css (7.5KB)

Purpose: Reusable utility classes and helper styles Contains:

Loading Strategy

The CSS files are loaded in the following order in _includes/head.html:

<!-- Critical CSS is inlined for above-the-fold content -->
<style>/* Critical CSS for FCP optimization */</style>

<!-- Load modular CSS architecture -->
<link rel="stylesheet" href="/assets/css/base.css">
<link rel="stylesheet" href="/assets/css/components.css">
<link rel="stylesheet" href="/assets/css/utilities.css">

<!-- Legacy fallback -->
<link rel="stylesheet" href="/assets/css/main.css" media="print" onload="this.media='all';">

Enhancement CSS

Additional enhancement files are loaded asynchronously:

Deprecated Files

The following files are now deprecated and consolidated into the modular structure:

Naming Conventions

The CSS follows BEM (Block Element Modifier) methodology where applicable:

/* Block */
.hero { }

/* Element */
.hero__content { }
.hero__title { }

/* Modifier */
.hero--dark { }
.hero__title--large { }

Performance Benefits

  1. Reduced File Size: Eliminated duplicate styles across files
  2. Better Caching: Modular files can be cached independently
  3. Faster Loading: Critical CSS inlined, non-critical CSS loaded progressively
  4. Maintainability: Clear separation of concerns between base, components, and utilities

Development Workflow

When adding new styles:

  1. Base styles → Add to base.css (typography, colors, reset styles)
  2. Component styles → Add to components.css (specific UI components)
  3. Utility classes → Add to utilities.css (reusable helper classes)

File Size Comparison

File Size Purpose
base.css 1.5KB Foundation styles
components.css 13KB All UI components
utilities.css 7.5KB Utility classes
Total Modular 22KB Complete modular system
main.css (legacy) 9.5KB Legacy fallback
community-activity.css 8.4KB ✅ Now in components.css
academy-pages.css 5.5KB ✅ Now in components.css

Browser Support

The modular CSS architecture supports all modern browsers and includes fallbacks for older browsers through the legacy main.css file.


Last updated: Task 34.3 - Create Modular CSS Architecture