Bem is a very useful, powerful and simple naming convention.
It makes the front-end code easier to read and understand, easier to collaborate, easier to control, more robust and clear and more rigorous, and easier to maintain code.
BEM Naming ideas:
. block{}.block__element{}.block--modifier{}
. Block{}. block__element{}. block--modifier{ }
Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.com
The naming convention pattern is as follows:
. Block{}. block__element{}. block--modifier{ }
Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.com
The naming convention pattern is as follows:
. Block{}. block__element{}. block--modifier{ }
Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.com
Block
Divide everything into a separate module.
A header is Block,header nested search box is block, even an icon a logo is also block,
Blocks can be nested with each other.
Element
All the element under a block, regardless of the level of each other, should spread flat and belong to block.
So BEM up to only b+e+m level three, it is impossible to appear b+e+e+. +e+m Long class name, also requires E cannot have the same name.
Modifier
. Current. Active and other expression states
Make the connection between everything so much tighter that it makes it easier for the team and even you to maintain that the code copyright is owned by the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.combem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.combem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.combem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.combem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.combem means blocks, elements (element), modifiers (modifier), a front-end naming methodology presented by the Yandex team. Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Original: Http://www.w3cplus.com/css/mindbemding-getting-your-head-round-bem-syntax.html? W3cplus.com
BEM naming in CSS