getbem/getbem.github.io

FAQ: What if some styles only apply to 1 element type?

mikeybinns opened this issue · 0 comments

For example, if I have button.button and a.button, the button a tag will have an underline. I know I could add this to the .button class, but then the button class would have to be more explicit and the more classes it has, the harder it might be to change in the future.
Would it make sense in this case to add any resets to a.button instead of .button?

From:

/* all button styles */
.button {
    border: 1px solid;
    text-decoration: none;
}

to

/* actual button styles */
.button {
    border: 1px solid;
}
/* single element reset styles */
a.button {
    text-decoration: none;
}