specificity property

int specificity
latefinal

This selector's specificity.

Specificity is represented in base 1000. The spec says this should be "sufficiently high"; it's extremely unlikely that any single selector sequence will contain 1000 simple selectors.

Implementation

late final int specificity =
    components.fold(0, (sum, component) => sum + component.specificity);