Specificity strategy

noun

say it: “spes-ih-FIS-ih-tee STRAT-uh-jee” /ˌspɛsɪˈfɪsɪti ˈstrætədʒi/

A team rule for keeping selectors equally simple, usually one class each, so it stays predictable which style wins and nobody needs !important.

What is a specificity strategy?

A specificity strategy is a team rule for keeping selectors equally simple, usually one class each, so styles override predictably without !important.

/* one class per selector */
.card { }
.card-title { }
.card--featured { }

In a sentence

  • “Our specificity strategy is one class per selector, so the last rule in the file wins a tie.”
  • “After we agreed on a specificity strategy, the !important count in our stylesheet dropped from 40 to zero.”

Level: Master · More CSS terms at this level

Updated