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
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
140
Other Decks in Programming
See All in Programming
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
270
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
300
サーバーサイドのビルド時間87倍高速化
plaidtech
PRO
0
720
Go言語での実装を通して学ぶLLMファインチューニングの仕組み / fukuokago22-llm-peft
monochromegane
0
120
rage against annotate_predecessor
junk0612
0
160
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.2k
OSS開発者という働き方
andpad
5
1.7k
Swift Updates - Learn Languages 2025
koher
2
470
Navigation 2 を 3 に移行する(予定)ためにやったこと
yokomii
0
120
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
230
開発チーム・開発組織の設計改善スキルの向上
masuda220
PRO
19
11k
個人軟體時代
ethanhuang13
0
320
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
We Have a Design System, Now What?
morganepeng
53
7.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Automating Front-end Workflow
addyosmani
1370
200k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
The Invisible Side of Design
smashingmag
301
51k
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/