Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
BEM Methodology
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jacek Spławski
January 17, 2016
Programming
0
1.2k
BEM Methodology
The basics, main principles, use BEM with Sass, use BEM with JS, pros and cons of BEM methodology
Jacek Spławski
January 17, 2016
Tweet
Share
More Decks by Jacek Spławski
See All by Jacek Spławski
Become a Git Superhero
zacol
0
150
Other Decks in Programming
See All in Programming
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
550
AI巻き込み型コードレビューのススメ
nealle
0
130
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
510
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Grafana:建立系統全知視角的捷徑
blueswen
0
330
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
CSC307 Lecture 01
javiergs
PRO
0
690
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
110
A designer walks into a library…
pauljervisheath
210
24k
Are puppies a ranking factor?
jonoalderson
1
2.7k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
180
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
91
Un-Boring Meetings
codingconduct
0
200
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
BEM Methodology Jacek Spławski Poznań, January 2016
We are not designing pages, we are designing systems of
components. — Stephen Hay
Modularity is requirement of maintainable systems. — Ben Callahan
OOCSS / SMACSS / BEM / Atomic / SUITCSS
BEM is a naming convention for classes in HTML and
CSS.
Created by Yandex — one of the leading internet companies
in Russia.
Block Element Modifier
Block is standalone entity that is meaningful on its own.
Blocks can be nested and interact with each other, semantically
they remain equal; there is no precedence or hierarchy.
Block names may consist of lowercase Latin letters, digits, and
dashes. Individual words within names are separated by a dash. .block
Block name should identify block and say what it is
responsible for. The block name replaces IDs.
Element is parts of a block and have no standalone
meaning. They are semantically tied to its block.
Element names may consist of Latin letters, digits, dashes and
underscores. CSS class is formed as block name plus two underscores plus element name. .block__element
Modifier are flags on blocks or elements. Use them to
change appearance or behavior.
Modifier names may consist of Latin letters, digits, dashes and
underscores. CSS class is formed as block’s or element’s name plus two dashes. .block__element——modifier
DOM Tree → BEM Tree
Sass — BEM .block { &——modifier {} &__element {} }
= .block {} .block——modifier {} .block__element {}
BEM ? JS
jQuery BEM Helpers jQuery BEM Plugin i-BEM framework by Yandex
no dependencies on other elements reduce cascading problems reduce amount
of CSS code create ready blocks library simple and understandable structure in CSS and HTML code Sass loves BEM drop tag names and IDs
long class names which could look’s weird develop the habit
to properly name class modular thinking
https://css-tricks.com/bem-101/ http://getbem.com/ https://en.bem.info/ https://www.smashingmagazine.com/ 2012/04/a-new-front-end-methodology- bem/