specificity-management
यह क्या करती है
यह स्किल स्टाइलशीट में उच्च-specificity वाले सिलेक्टर, गहरी नेस्टिंग और बेकार important फ़्लैग जाँचती है और उन्हें सरल बनाती है। यह उन फ़्रंट-एंड डेवलपर्स के लिए है जिन्हें अपनी स्टाइल बदलना मुश्किल लगता है।
कब इस्तेमाल करें
- ✓जब आप एजेंट से ऐसी स्टाइलशीट साफ़ करवाएँ जिसे ओवरराइड करना मुश्किल हो।
- ✓जब डेवलपर स्टाइल चलाने के लिए बार-बार !important जोड़ते हों।
- ✓जब कंपोनेंट स्टाइल टकराएँ क्योंकि सिलेक्टर बहुत विशिष्ट या गहराई में नेस्टेड हैं।
Skill का लिंक
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/specificity-management/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी स्टाइलशीट !important और ID सिलेक्टर से भरी है, और हर बदलाव कुछ तोड़ देता है। क्या आप उसे सरल कर सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट ID पर आधारित स्टाइल, गहरे नेस्टेड सिलेक्टर और बेवजह के !important फ़्लैग खोजता है। वह उन्हें क्लास सिलेक्टर से बदलता है, नेस्टिंग घटाता है, और जहाँ मदद करे वहाँ :where() जैसे शून्य-specificity पैटर्न इस्तेमाल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Keep CSS specificity low and flat
High specificity creates an escalation problem — 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.
Quick Reference
- Prefer class selectors over ID selectors for styling
- Avoid nesting selectors more than 3 levels deep
- Never use !important except as a last resort for utility overrides
- Use :where() to apply styles with zero specificity
Check
Analyze the selectors in this CSS file for specificity issues: ID selectors used for styling, overly nested selectors, and unnecessary !important.
Fix
Flatten high-specificity selectors to use classes instead of IDs, reduce nesting depth, and remove unnecessary !important declarations.
Explain
Explain CSS specificity scoring, why high specificity causes maintenance problems, and how to keep specificity flat using classes and BEM.
Code Review
Review 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.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/css/specificity-management
अक्सर पूछे जाने वाले सवाल
specificity क्या है?
यह वह स्कोर है जिसके आधार पर ब्राउज़र तय करता है कि जब एक ही एलिमेंट पर कई नियम लगें, तो कौन-सा नियम जीतेगा।
!important क्यों समस्या है?
स्किल कहती है कि यह समस्या बढ़ाता है, क्योंकि अगले ओवरराइड के लिए अक्सर एक और !important चाहिए होता है।
BEM कैसे मदद करता है?
स्किल कहती है कि BEM क्लास नाम specificity को सपाट रखते हैं और कैस्केड को अनुमान योग्य बनाते हैं।
जानकारी
लेखक का मूल विवरण
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.
लोकप्रियता
- GitHub स्टार
- 75k
- रैंकिंग में स्थान
- #3031
- लाइसेंस
- MIT
- अपडेट की गई
- 31/10/2026
कमेंट
- …
इस repository की और skills
frontendchecklist
75kकमांड-लाइन टूल से फ़्रंटएंड कोड और लाइव पेजों को एक्सेसिबिलिटी, स्पीड, SEO और सिक्योरिटी के 380 से ज़्यादा नियमों से जाँचती है।
frontend-checklist-global
75kफ़्रंटएंड प्रोजेक्ट को Front-End Checklist के सभी 386 नियमों से ऑडिट करती है, और हर मिली समस्या का ठोस समाधान देती है।
404-page
75kजाँचती है कि आपका गुम पेज उपयोगी लिंक देता है और सही 404 स्टेटस लौटाता है, ताकि भटके हुए विज़िटर रास्ता ढूँढ सकें।
about-page
75kजाँचती है कि आपकी साइट पर एक साफ़ About पेज है जो बताता है कि उसे कौन चलाता है, ताकि विज़िटर और सर्च इंजन का भरोसा बढ़े।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।