Course contentsShow
← Web Development
Lesson 1339 of 2,98224. CSS Architecture and MaintainabilityFree lesson

ITCSS Layer Ordering and Import Strategy

Structure your build to import layers in correct order, ensuring specificity increases naturally.

ITCSS Layer Ordering and Import Strategy

You'll learn how to arrange your ITCSS layers in the correct sequence so CSS specificity naturally increases from generic to specific, preventing override conflicts.

Why Order Matters

ITCSS (Inverted Triangle CSS) works because it respects the cascade. Each layer should be more specific than the one before it. Think of building a house: foundation first, walls second, then decorative trim. If you painted the trim before building the walls, you'd have to repaint everything.

Your CSS imports must follow this exact order:

  1. Settings – Variables only, no output
  2. Tools – Mixins and functions, no output
  3. Generic – Browser resets (lowest specificity)
  4. Elements – Bare HTML tags like h1, p
  5. Objects – Layout primitives with classes
  6. Components – Specific UI patterns
  7. Utilities – Highest specificity overrides

The Import Structure

In your main stylesheet, import layers in order:

@import 'settings/colors.css';
@import 'settings/typography.css';
@import 'tools/mixins.css';
@import 'generic/normalize.css';
@import 'elements/headings.css';
@import 'elements/links.css';
@import 'objects/layout.css';
@import 'components/button.css';
@import 'components/card.css';
@import 'utilities/spacing.css';

Why This Prevents Conflicts

Because each layer is slightly more specific, you rarely need !important. A utility class naturally overrides a component style, which naturally overrides an element style. The cascade does the work for you.

If you import utilities before components, you'll constantly fight specificity battles and resort to hacks.

Key Takeaway: Import ITCSS layers in strict order from least to most specific—Settings, Tools, Generic, Elements, Objects, Components, Utilities—to harness the cascade naturally and avoid specificity wars.