Answer the question
In order to leave comments, you need to log in
Are CSS sprites compatible with BEM?
Hi all!
I have been doing layout for a long time, at the moment I want to switch to BEM. While I deal with the folder structure, class names. In test mode, I make up a small project in manual mode. When I understand the structure, I will switch to a full-fledged BEM.
As far as I understand, one of the tasks of BEM is layout with independent blocks, and here I have a question: if we use CSS sprites, does this mean that we destroy the principle of independence of blocks in advance by attaching one graphic file to different elements with all, for example, icons?
By analogy, we look at the file structure of the block:
menu/
__item/
_state/
menu__item_state_current.css
menu__item_state_current.xsl
menu__item.css
menu__item.xsl
menu.css
menu.js
menu.xsl
Answer the question
In order to leave comments, you need to log in
You can store images in folders, individually.
And during the assembly process, collect all this into one sprite.
I don't see any problem with this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question