Architecture Decision Records (ADRs)

← Home

Use of SASS partials instead of one big sass file

Introduction

Use SASS partials to organize your CSS into logical manageable chunks.

Decision

Partials should be used to organize stylesheets to make things more modular and easier to maintain.

Example:


  // main.scss 

  @import "01-base/_all"; 
  @import "00-starter/_all"; 
  @import "02-atoms/_all"; 
  @import "03-molecules/_all"; 
  @import "04-organisms/_all"; 
  @import "05-layouts/_all"; 
  @import "06-misc/_all";
  

Context

The larger a stylesheet grows, the harder it is to maintain. By splitting large stylesheets into smaller chunks, it allows codebases to become more maintainable in the long run because things are easier to find, and the smaller focused files are easier to read and understand.

Consequences

Exceptions

Additional Resources

← See more ADRs