View all rules

S5 Don’t nest BEM child selectors

Don’t nest BEM child selectors for CSS specificity reasons. Also, because of the way CSS parsing works, this has performance benefits.

    
.c-button {
    padding: 1rem 0.8rem;
    &--primary {
        background: blue;
    }
}
    
    
.c-button {
    padding: 1rem 0.8rem;
}

.c-button—-primary {
    background: blue;
}