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 - A simple CSS methodology
Search
Matheus Richard
March 19, 2020
Programming
0
48
BEM - A simple CSS methodology
A short introduction to the BEM methodology for writing CSS.
Matheus Richard
March 19, 2020
Tweet
Share
More Decks by Matheus Richard
See All by Matheus Richard
The Fast Lane: Asynchronous Rails
matheusrich
0
35
Build in Private
matheusrich
0
63
Start TDDing in 5 minutes
matheusrich
0
94
3 Steps Every Test Should Take
matheusrich
0
76
Taming God Objects: easy, incremental and secure
matheusrich
1
93
Stimulus 2.0-alpha - What's new?
matheusrich
0
49
De Repente 7
matheusrich
0
12
Other Decks in Programming
See All in Programming
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
210
GraphRAGの仕組みまるわかり
tosuri13
8
480
ASP.NETアプリケーションのモダナイズ インフラ編
tomokusaba
1
410
Team operations that are not burdened by SRE
kazatohiei
1
210
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
380
ニーリーにおけるプロダクトエンジニア
nealle
0
470
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1k
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
340
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
360
Select API from Kotlin Coroutine
jmatsu
1
190
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
The Pragmatic Product Professional
lauravandoore
35
6.7k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Producing Creativity
orderedlist
PRO
346
40k
Automating Front-end Workflow
addyosmani
1370
200k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
210
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Speed Design
sergeychernyshev
32
1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Transcript
BEM Easy. Modular. Flexible.
What comes to your mind when you think of CSS?
None
And CSS in a big project?
None
Why?
Why do we have a low bar in terms of
CSS code quality?
Web History • Everything was designed to share documents •
CSS had a different intention • Web apps became a thing
Several problems
Inline CSS Code duplication Browser incompatibility
None
Goals • Reuse code • Organization • Standardization • Modularization
• Simplicity
BEM Block__Element--Modifier
Block Standalone entity that is meaningful on its own.
Block Naming Block names may consist of Latin letters, digits,
and dashes
Element A part of a block that has no standalone
meaning and is semantically tied to its block
Element An element CSS class is formed as block name
plus two underscores plus element name
None
Element An element CSS class is formed as block name
plus two underscores plus element name
Element An element CSS class is formed as block name
plus two underscores plus element name
Modifier A flag on a block or element. Use them
to change appearance or behavior.
Modifier Naming A modifier CSS class is formed as block’s
or element’s name plus two dashes
Modifier HTML Remember that modifiers only carry modifications!
Rule of thumb Use meaningful names
None
Benefits
Modularity • Block styles are independent. No cascading problems. •
You also get the ability to transfer blocks from your finished projects to new ones.
Reusability • Composing independent blocks in different ways, and reusing
them intelligently, reduces the amount of CSS code that you will have to maintain. • You can build a library of blocks.
Structure • BEM methodology gives your CSS code a solid
structure that remains simple and easy to understand.
Easy • Only three core elements • No 3rd-party library
needed • You can start applying it now
That’s it Feel free to ask any question
That was just the basics... • https://en.bem.info/methodology/quick -start/ • http://getbem.com/introduction/