R
R
Roman Nazarkin2018-09-01 22:02:18
css
Roman Nazarkin, 2018-09-01 22:02:18

Where to place global styles in BEM?

I use the following file structure in my project:


assets
-- bootstrap.js
-- jquery.js
site-blocks
-- gallery
---- gallery.js
---- gallery.scss
-- header
---- header.scss
---- header__nav.scss
-- -- header.js

That is, the code of each block is in its own folder. When building a project, files are combined by technology without any priority in order (because they do not depend on each other), but the question arises: where is it more correct (according to BEM) to place global styles, for example, for body, links, etc.? exactly the same question for global js code (for example, initializing global variables, loading libraries)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2018-09-01
@werty1001

There are no global styles in BEM, they simply become unnecessary, but place them where it is convenient, there is no right option here.

L
lamer350, 2018-09-02
@lamer350

Any global styles need to be connected above the rest in html, no matter what folders they will be in.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question