Why Not Just Edit the Component?
Every file under lib/layouts/components/ arrives from this library and is overwritten on reinstall. Nothing stops you from editing one, and sometimes that is the right call. But the moment you do, npm run components:status reports the component as modified, and adopting any future canon update becomes a merge instead of a copy.
A site that wants a component to look different has two bad options: edit the canon file, which makes the next update a merge, or out-specify it from site CSS, which turns styling into a specificity contest. Cascade layers remove the contest.
The Layer Order
With layers enabled in metalsmith-bundled-components (version 1.4.0 or later; the Metalsmith2025 starter ships with it on), the bundled CSS declares its layer order up front, and every piece of CSS lands in a named layer:
@layer tokens, base, components, site;
@layer components.hero {
.hero { ... } /* canon component CSS, untouched on disk */
}
@layer site.hero {
.hero { --hero-gap: var(--space-l); } /* your override */
}In the cascade, a later layer beats an earlier one regardless of specificity. Anything in site beats anything in components, whatever its selector and wherever it sits in the file. A one-class override wins over a canon rule with three, so overrides stay small, and there is no !important and no .page .section .hero .text arms race.
One rule comes with this model, and it is not optional: unlayered CSS beats every cascade layer. Your site's own stylesheets must be assigned to layers too, below components, or one bare @import will outrank the entire component catalog. In the starter, every import in lib/assets/main.css names its layer for exactly this reason.