R
R
Roman Fov2015-08-10 15:27:58
BEM
Roman Fov, 2015-08-10 15:27:58

How to add normalize.css to bem ENB project?

Hello!
Mastering enb. I want to add normalize to css. I install it via bower. I create a desctop.blocks/normalize block. In desctop.blocks/normalize/normalize.css I write the import:

@import url(../../libs/normalize.css/normalize.css);

In desctop.blocks/page/page.deps.js I add a dependency on the normalize block:
({
    tech : 'tmpl-spec.js',
    mustDeps: { block: 'normalize' },
    shouldDeps : {
        elems : ['conditional-comment']
    }
})

Eee... It doesn't fit in the css. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
i, 2015-10-05
@Roman-Fov

In the above example, the indication of dependencies for the tmpl-spec.js technology is used for template tests, for this reason { block: 'normalize' }it does not get into css during assembly in order to connect the styles and scripts of the desctop.blocks/page/page.deps.js blocks to the project :

[{
    mustDeps: { block: 'normalize' },
}]

An example of describing a dependency by technology together with common block dependencies https://github.com/ilyar/bem-examples/blob/master/...
More about describing dependencies https://ru.bem.info/technology/deps/about/
And yet, using global styles (normalize / reset) contradicts the trailer: "A block is an independent component", more: experience and recommendation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question