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
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
1
210
DROBEの生成AI活用事例 with AWS
ippey
0
110
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
3.1k
定理証明プラットフォーム lapisla.net
abap34
1
670
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
130
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
2.4k
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
150
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.2k
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
4.6k
令和7年版 あなたが使ってよいフロントエンド機能とは
mugi_uno
12
6.1k
CloudNativePGがCNCF Sandboxプロジェクトになったぞ! 〜CloudNativePGの仕組みの紹介〜
nnaka2992
0
200
2024年のWebフロントエンドのふりかえりと2025年
sakito
1
150
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
6
230
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
29
2.2k
Optimizing for Happiness
mojombo
376
70k
Agile that works and the tools we love
rasmusluckow
328
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
A Tale of Four Properties
chriscoyier
158
23k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Automating Front-end Workflow
addyosmani
1367
200k
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/