{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-specificity-management-90db74f047d6","title":"Keep CSS Specificity Low and Flat","summary":"Flatten CSS selectors and reduce specificity to ensure predictable styling. Use classes instead of IDs, avoid nesting deeper than three levels, and remove unnecessary !important declarations.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-specificity-management-90db74f047d6","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-specificity-management-90db74f047d6","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-specificity-management-90db74f047d6.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-specificity-management-90db74f047d6\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before applying fixes, validate that the CSS file is correctly imported and that no framework-specific overrides are in place. The first deliverable is a list of high-specificity selectors identified in the stylesheet.","instructions":"---\nname: specificity-management\ndescription: \"Use when reviewing stylesheets, component styles, and responsive behavior related to Keep CSS specificity low and flat. Check the rendered layout across breakpoints and interaction states before proposing a fix.\"\nmetadata:\n  category: css\n  priority: high\n  difficulty: intermediate\n  estimatedTime: \"20\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/css\/specificity-management\n---\n\n# Keep CSS specificity low and flat\n\nHigh specificity creates an escalation problem \u2014 once you use an ID selector, you need another ID to override it. Developers respond with !important, which escalates further. Flat, low-specificity CSS is predictable: later rules and more-specific selectors win cleanly, and the cascade works as intended.\n\n## Quick Reference\n\n- Prefer class selectors over ID selectors for styling\n- Avoid nesting selectors more than 3 levels deep\n- Never use !important except as a last resort for utility overrides\n- Use :where() to apply styles with zero specificity\n\n## Check\n\nAnalyze the selectors in this CSS file for specificity issues: ID selectors used for styling, overly nested selectors, and unnecessary !important.\n\n## Fix\n\nFlatten high-specificity selectors to use classes instead of IDs, reduce nesting depth, and remove unnecessary !important declarations.\n\n## Explain\n\nExplain CSS specificity scoring, why high specificity causes maintenance problems, and how to keep specificity flat using classes and BEM.\n\n## Code Review\n\nReview stylesheets, component styles, and responsive states related to Keep CSS specificity low and flat. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/css\/specificity-management\n","use_cases":["Reviewing stylesheets for ID selectors and high-specificity rules","Fixing nested selectors that exceed three levels","Removing !important declarations from utility classes"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/specificity-management\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T05:43:18.000000Z","updated_at":"2026-11-24T07:12:32.000000Z","seo_title":"Keep CSS Specificity Low and Flat","seo_description":"Learn how to maintain low CSS specificity for predictable styling. Avoid ID selectors, reduce nesting, and use classes for maintainable code.","seo_keywords":["CSS specificity management","low specificity CSS","flatten CSS selectors","avoid ID selectors","reduce nesting depth"]}}