For blocks which receive unique styling, I try to use class names to create a pattern for what belongs to what: .navigation-button -> .navigation-button-text, .navigation-button-icon, etc. This means that those unique styles won't cascade unexpectedly down into other elements later.
However, for components which will certainly be reused, I try to use BEM when possible. Not every button will be a button.sign-in, so I continue to try and scope my styles using css.
If I need something super consistent I'll just try and find a library like Bootstrap, which has already made those decisions for me.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For blocks which receive unique styling, I try to use class names to create a pattern for what belongs to what:
.navigation-button
->.navigation-button-text
,.navigation-button-icon
, etc. This means that those unique styles won't cascade unexpectedly down into other elements later.However, for components which will certainly be reused, I try to use BEM when possible. Not every
button
will be abutton.sign-in
, so I continue to try and scope my styles using css.If I need something super consistent I'll just try and find a library like Bootstrap, which has already made those decisions for me.