X
X
Xenofit2020-02-19 14:21:34
css
Xenofit, 2020-02-19 14:21:34

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

6 answer(s)
A
approximate solution, 2020-02-19
@approximate_solution

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.

B
burhanoff1992, 2020-02-20
@burhanoff1992

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.?

1. Well, why without reset / normalize? they should be placed above your main stylesheet in the connection queue.
2. Is it really difficult for you to manually write zero indents for body and ul? Hold:
body {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

3. Soon you will meet with a bunch of other nuances that against their background this question will be ridiculous

Y
YarosWD, 2020-02-19
@YarosWD

Here is a good article and video on this topic https://htmlacademy.ru/blog/useful/css/short-13

A
Alexey Nikolaev, 2020-02-19
@Heian

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 .

X
Xenofit, 2020-02-20
@Xenofit

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 question

Ask a Question

731 491 924 answers to any question