A
A
Anton2016-11-16 19:07:10
css
Anton, 2016-11-16 19:07:10

Some questions about BEM?

Hello. I'm studying bam and I have some questions

  1. How to position blocks? If I need a block that is, for example, in the center, can I write in the styles of this block margin: 0 auto;?
  2. As I saw modifiers should look like this element_key_value is it possible to create modifiers without being tied to an element, for example color_red?
  3. I saw classes such as page, content-wrapper, and maybe there is where to read about them in Russian?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Goryachev, 2016-11-16
@webirus

frontender.info/MindBEMding
https://nicothin.github.io/idiomatic-pre-CSS/

A
Andrey Verkh, 2016-11-16
@sadisme

Not a BEM expert, but
1. Blocks also have a parent. Therefore, the block is also an "element" of some block. It will be: "some-block header__block" where you hang all the design on "some-block", and positioning on "header__block"
2. No. It's written in the docs. The modifier does not exist separately. You can create a "mixin" ... like a universal class, with a set of rules.
3. The question is not understood

A
Anton Krichevsky, 2016-12-16
@skad0

1. You can, for example, in the parent block, mix an element to the centered block

{
    block: 'parent',
    content: {
        block: 'child',
        mix: {  block: 'parent', elem: 'childy'  }
    }
}

and then
2. The modifier can only be used in relation to something (block or element)
3. Please specify the question

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question