Summary
Several component CSS modules use !important declarations to override specificity conflicts. This is a code smell indicating underlying CSS architecture issues and makes styles harder to override for consumers.
Goal
Eliminate all !important declarations by fixing the underlying specificity issues through proper CSS cascade, selector specificity, or CSS Modules scoping.
Affected Components
| Component |
Issue |
Details |
| Search (#632) |
item 1 |
Two !important flags (lines 17, 21) — specificity conflicts |
| FilterChip (#616) |
item 1 |
11 !important declarations — heavy specificity issues |
| CodeBlock (#606) |
item 1 |
!important on .token.comment color in syntax theme |
| Calendar (#602) |
item 3 |
.calendarPopover uses !important for padding and border |
Common Fixes
- Increase selector specificity — use CSS Modules'
:local scoping or add a parent class
- Reorder CSS — ensure component styles load after base/reset styles
- Use
@layer — CSS cascade layers to control specificity without !important
- Flatten selectors — reduce nesting that causes specificity wars
Acceptance Criteria