Zazz Design Framework
base

layers.css

The cascade layer architecture that lets utility classes override components without specificity conflicts.

_layers.css defines the cascade layer order for the framework. Layer order determines rule precedence instead of selector specificity.

@layer variables, reset, legacy, zazz, migrations;

@layer zazz {
  @layer components, utilities;
}

index.css imports _layers.css first to establish this ordering before rules are defined.

Layer precedence

Later layers override earlier layers regardless of selector specificity:

<!-- .ui-button sets background in @layer zazz.components.
     .bg-primary sets background in @layer zazz.utilities and overrides it cleanly. -->
<button class="ui-button bg-primary">Save</button>

Layer definitions

Priority order runs from lowest to highest:

LayerPurposeFile
variablesDesign tokens on :root_variables.css + component token blocks
resetElement baselines and control resets_reset.css
legacyExisting pre-Zazz CSS in migrationsApp entry stylesheet
zazz.componentsComponent rulesprimitives/<name>/<name>.css
zazz.utilitiesAtomic utility classes_utilities.css
migrationsTemporary translation shims for legacy class migrationCustom migrations.css

Inside zazz, utilities follows components, guaranteeing utility overrides.

Unlayered CSS

Rules declared outside of any @layer override all layered rules regardless of specificity:

/* Unlayered rule overrides layered components and utilities */
.ui-button {
  border-radius: 0;
}

To create custom overrides that remain structured, declare an app layer after Zazz instead:

@layer variables, reset, legacy, zazz, migrations, app;

@layer app {
  .ui-button {
    border-radius: 0;
  }
}

Legacy CSS integration

Import legacy stylesheets into @layer legacy:

@import "./legacy-app.css" layer(legacy);

Zazz component and utility styles will override legacy styles where selectors overlap.

Browser support

Cascade layers are Baseline widely available across Chrome, Edge, Firefox, and Safari.

On this page