Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
50
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
42
Build in Private
matheusrich
0
69
Start TDDing in 5 minutes
matheusrich
0
110
3 Steps Every Test Should Take
matheusrich
0
89
Taming God Objects: easy, incremental and secure
matheusrich
1
110
Stimulus 2.0-alpha - What's new?
matheusrich
0
51
De Repente 7
matheusrich
0
15
Other Decks in Programming
See All in Programming
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
React Native New Architecture 移行実践報告
taminif
1
150
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
420
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
120
関数実行の裏側では何が起きているのか?
minop1205
1
680
Integrating WordPress and Symfony
alexandresalome
0
150
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
1.6k
dnx で実行できるコマンド、作ってみました
tomohisa
0
140
AtCoder Conference 2025「LLM時代のAHC」
imjk
1
310
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
140
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
141
7.2k
How GitHub (no longer) Works
holman
316
140k
BBQ
matthewcrist
89
9.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.1k
Designing for humans not robots
tammielis
254
26k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Facilitating Awesome Meetings
lara
57
6.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
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/