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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
400
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
100
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
ThorVG Viewer In VS Code
nors
0
760
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
Designing for Timeless Needs
cassininazir
0
130
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Faster Mobile Websites
deanohume
310
31k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
82
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
How to Think Like a Performance Engineer
csswizardry
28
2.4k
A better future with KSS
kneath
240
18k
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/