pub struct StylingHealthPenalties {
pub duplication: f64,
pub dead_surface: f64,
pub broken_references: f64,
pub token_erosion: f64,
pub structural: f64,
}Expand description
Per-category penalty breakdown for the styling-health score. Each field is the
number of points subtracted from a starting 100 for one CSS signal family,
already capped at its category ceiling. A 0.0 field means “the signal was
evaluated and clean”; the whole struct is only ever built when CSS analytics
were produced, so there is no “missing pipeline” ambiguity to model with
Option here (the parent StylingHealth is itself Option on the report).
Fields§
§duplication: f64Copy-paste declaration blocks (duplicate_declaration_blocks), scaled by
total removable declarations. Capped at 20pt.
dead_surface: f64Dead styling surface, two independently-normalized terms summed and capped
at 20pt: (a) unused @theme tokens as a share of the total @theme token
population (size-independent, so a declaration-sparse Tailwind project is
not penalized for a few dead tokens); plus (b) the other dead entities
(unreferenced classes, unused @property/@layer at-rules, dead
@font-face families) as a share of total_declarations.
broken_references: f64Broken references: markup classes one edit from a defined class
(unresolved_class_references) and animations referencing a @keyframes
defined nowhere (undefined_keyframes). Capped at 15pt.
token_erosion: f64Design-token erosion: mixed font-size units (font_size_unit_mix),
Tailwind arbitrary-value bypasses (tailwind_arbitrary_values), and
distinct HARDCODED box-shadow/border-radius/line-height values above
per-axis baselines (the v3 value-sprawl drift sub-term; var(--*)-
referenced values are not counted). Capped at 10pt.
structural: f64Structural smells from the summary aggregates: !important density and
deep style-rule nesting. Capped at 10pt.