SCSS Architecture Documentation
Technical documentation for the SCSS codebase. This folder contains all stylesheets organized in a modern, scalable architecture following mobile-first design principles and BEM methodology.
📖 Project Overview: See main
/README.mdfor project setup, features, and general information.
🏗️ Folder Organization
/utilities/ - Core Configuration
Foundation utilities used throughout the project.
_variables.scss- Global SCSS variables (colors, spacing, fonts, breakpoints, shadows)_mixins.scss- Reusable SCSS mixins and responsive breakpoint functions
/base/ - Global Foundation
Base styles that apply globally across the entire site.
_base.scss- Enhanced CSS reset, global element styles, accessibility features, focus management, and utility classes_typography.scss- Global typography rules (body, headings, paragraphs, links)_shared.scss- Shared layout containers, section wrappers, and common structural elements
/components/ - Reusable UI Components
Modular, reusable components following BEM methodology.
_buttons.scss- BEM-compliant button system with variants (primary, secondary, dark, etc.) and sizes_carousel.scss- Carousel/slider mechanics and responsive behavior_header.scss- Header navigation and mobile menu functionality
/sections/ - Page Content Areas
Section-specific styles organized by content area, all mobile-first and properly nested.
_hero.scss- Hero section with responsive backgrounds and typography_about.scss- About section layout and content styling_solutions.scss- Solutions section with card layouts_projects.scss- Projects carousel and card components_testimonials.scss- Testimonials carousel with responsive behavior_insights.scss- Insights/news section styling_careers.scss- Careers section layout_cta.scss- Call-to-action sections with background overlays_footer.scss- Footer layout and responsive behavior
Root Level
main.scss- Main entry point that imports all partials in proper cascade ordermain.css- Compiled CSS outputREADME.md- This documentation file
📋 Import Order & CSS Cascade
The main.scss file follows this specific import order to ensure proper CSS cascade:
// 1. Utilities (Configuration)
@use 'utilities/variables' as *;
@use 'utilities/mixins' as *;
// 2. Base Styles (Foundation)
@use 'base/base'; // Reset, accessibility, utilities
@use 'base/typography'; // Global typography
@use 'base/shared'; // Containers, sections
// 3. Components (Reusable UI)
@use 'components/carousel'; // Must come before sections using .carousel-card
@use 'components/header'; // Navigation components
@use 'components/buttons'; // Button system
// 4. Sections (Page Content)
@use 'sections/hero';
@use 'sections/about';
@use 'sections/solutions';
@use 'sections/projects';
@use 'sections/testimonials';
@use 'sections/insights';
@use 'sections/careers';
@use 'sections/cta';
@use 'sections/footer';
🎯 Architecture Principles
Mobile-First Design
- All sections start with mobile styles as the base
- Progressive enhancement using
@include tablet-upand@include desktop-upmixins - Responsive breakpoints: 768px (tablet), 1024px (desktop)
BEM Methodology
- Block:
.button,.carousel-button,.nav-button - Element:
.button__icon,.carousel-button__icon - Modifier:
.button--primary,.button--small,.carousel-button--dark
Accessibility First
- Focus management with
focus-visiblesupport - Screen reader utilities (
.visually-hidden,.sr-only) - Skip links for keyboard navigation
- Semantic color contrast using brand variables
Performance Optimized
- Modular imports allow selective loading
- Compiled CSS is optimized and minified
- Variables prevent code duplication
- Mixins reduce repetitive responsive code
🚀 Recent Improvements
Enhanced Base Styles
- Comprehensive CSS reset with
::beforeand::after - Modern focus management and accessibility features
- Text selection styling with brand colors
- Responsive media element defaults
BEM Button System
- Standardized button classes replacing custom variants
- Backward compatibility with legacy class names
- Consistent sizing and color variants
- Proper button element reset
Mobile-First Refactoring
- All sections converted to mobile-first approach
- Proper nesting and reduced code duplication
- Consistent use of spacing and typography variables
- Improved carousel functionality and responsive behavior
📝 Development Guidelines
Adding New Files
- Placement: Choose folder based on purpose (base/components/sections)
- Naming: Use underscore prefix for partials (
_new-section.scss) - Imports: Add to
main.scssin appropriate cascade order - Variables: Use existing variables from
_variables.scss - Mobile-First: Start with mobile styles, enhance for larger screens
Code Standards
- Use BEM methodology for new components
- Follow mobile-first responsive design
- Leverage existing mixins and variables
- Include accessibility considerations
- Document complex functionality with comments
File Structure
styles/
├── utilities/ # Variables, mixins, functions
├── base/ # Global resets, typography, containers
├── components/ # Reusable UI components (BEM)
└── sections/ # Page-specific content areas
🛠️ Build Process
- Development:
npm run build-css- Compiles SCSS to CSS - Output:
main.css- Optimized, compiled stylesheet - Watch: Files are compiled on save during development
- Production: CSS is minified and optimized for deployment