BEM vs Global Resets

716 Views Asked by At

I recently started using BEM for writing reusable CSS components. In the BEM documentation and other websites I found that global resets on tag elements are not encouraged for obvious reasons.

However when I look at source code of BEM based websites including the BEM documentation websites, I usually see p tags classless, meaning they do use resets or nested selectors to give them the proper font size or margin for instance.

Consequently, I am confused about what approach to follow now. In my reckoning, creating a paragraph class and attaching it to p tags would be the correct approach in this case. Further positioning could be resolved by implementing additional layout components to set the desired margins?

Any advice? Thanks in advance?

1

There are 1 best solutions below

0
On

My understanding is that a css reset is not required because essentially every block or element has a class on with a specificity set to 010. Therefore this overrides any css including the browsers own css file that only has a specificity set to 001 on the element.