Use when writing, reviewing, or refactoring Angular component styles (SCSS/CSS). Triggers on BEM naming issues, deep nesting, non-flat selectors, or hard-coded values instead of design tokens.
Use this skill to keep component styles predictable, reusable, and easy to review. Prefer component-scoped BEM classes and keep selectors flat by default.
references/review-checklist.md.LoginComponent -> <div class="login ...">.form) MUST explicitly wrap their elements (e.g. .form__input).<input class="form__input"> (Orphan element)<div class="form"><input class="form__input"></div><div class="login public-shell__form-wrapper"> (Login depends on Shell implementation)<div class="login auth-layout"> (Both use a generic .auth-layout block)&):&__element and &--modifier to keep the Block name DRY..card { &__title { ... } } compiles to .card__title.block__element__sub.&__header &__logo { ... } (Target &__logo only when inside &__header).block__a .block__b .block__c is invalid).>, +, ~ when used within the same block context and kept to one level.var(--space-*), var(--color-*)) instead of hard-coded values.*.component.scss; do not move feature-specific styles to global files.[class.card--active]="isActive()".@if, @for, @switch) without changing class semantics.Use this pattern to style an element differently based on its container within the same Block, avoiding new modifier classes for every positional tweak.
Valid:
.card {
&__header {
display: flex;
align-items: center;
}
// Contextual Override: Logo inside Header
&__header &__logo {
margin-right: var(--space-4);
height: 32px;
}
// Standard Element
&__logo {
height: 48px;
}
}
Invalid (Deep Nesting):
.card {
&__header {
// Bad: deeply nested selector
.card__logo {
...
}
}
}
When implementing or refactoring, produce:
block, elements, modifiers).references/review-checklist.md.Use these references when needed:
references/review-checklist.md for review criteria and fix patterns.