Answer the question
In order to leave comments, you need to log in
NO to general reset of styles in BEM! What's in return?
Hello everyone, about BEM. I'm just starting to explore the web, now I'm reading information on BEM. The official website says:
"Why not do a global reset?
Blocks should not be affected by the CSS rules created for the whole page. This breaks their independence and makes it difficult to reuse.
Global reset of styles is essentially implemented using global CSS -rules that in most cases are written for tag selectors, which is undesirable to do in a BEM project."
So the question arises, how to be then without reset and normalize? Even html and body cannot be reset? But what about ul-ki, etc.? Googled, everywhere they write why you should not use a reset with this methodology, BUT they do not offer solutions. How to be?
Answer the question
In order to leave comments, you need to log in
In most projects we use - Normilize.css , without it in any way. Plus for body default styles with fonts, base sizes and so on and so forth.
All this works with the BEM collaboration.
The question is really weird.
So the question arises, how to be then without reset and normalize? Even html and body cannot be reset? But what about ul-ki, etc.?
body {
margin: 0;
}
ul, ol {
margin: 0;
padding: 0;
list-style-type: none;
}
Here is a good article and video on this topic https://htmlacademy.ru/blog/useful/css/short-13
Brad that proves that working for a top company won't make you a programming genius. Browsers have default styles created for the entire page that they apply to each block, which breaks their independence and makes reusability difficult .
Thanks everyone for the replies! Now I understand roughly which direction to go. To summarize: 1) Use the recommended styles from BEM from the first answer.
2) Use normalize, BUT with possible edits based on the project.
3) Write the same (if you can call it that) reset for body, html, ul, etc. manually in a separate css file.
For some reason I liked the first option more.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question