Skip to content
Fallow home
All docs pages

Docs home

CSS duplicate block

What a css-duplicate-block finding of fallow health means, why it matters and how to fix it.

What it reports

CSS or CSS-in-JS declaration block is duplicated across rules.

Styling explains how fallow finds it.

Why it matters

A style rule declaration block is repeated across selectors, suggesting copy-pasted styling that can often be consolidated. The finding is advisory by default and does not affect the audit verdict unless rules.css-duplicate-block is set to error.

Example

.card in src/card.css and .panel in src/panel.css declare the same four or more declarations.

Fix

Move the shared declarations to one class or a shared mixin, and use it from both places.

Facts

FactValue
Issue typecss-duplicate-block
Rule id in SARIF outputfallow/css-duplicate-block
Commandfallow health
Default severitywarn
Config key in rulescss-duplicate-block
Suppression comment// fallow-ignore-next-line css-duplicate-block
Fixable with fallow fixNo
Opt-inNo