Cascading Specificity Guard

Structure stylesheets with CSS cascade layers — `@layer base, layout, components, utilities;` — so layout utilities (gap, margin, padding, alignment, display) always win over component styles without `!important` or specificity hacks. Use this whenever writing a stylesheet or <style> block longer than a few rules, setting up CSS for a prototype/page/design system, adding utility classes, or debugging "my gap/margin/padding class isn't applying", "the component overrides my utility", "why do I need !important", "specificity war", or "CSS order matters". Also use when integrating third- party or framework CSS (Tailwind, normalize, a vendor stylesheet) alongside custom styles.

fernandokylas Updated

File contents

fernandokylas/editorial-web-craft/tree/main/skills/cascading-specificity-guard commit 6060e57f7d

Frequently asked questions

npx skillmds@latest add fernandokylas/cascading-specificity-guard