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 for Real Programmers
Search
Mattijs Bliek
July 15, 2016
Programming
48
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
BEM for Real Programmers
Internal talk at Mollie
Mattijs Bliek
July 15, 2016
More Decks by Mattijs Bliek
See All by Mattijs Bliek
Vim for newbies
mattijsbliek
0
67
A Front-end Designer's Guide to the Galaxy
mattijsbliek
0
140
Digital Design for Humans
mattijsbliek
1
160
Designing in the Future
mattijsbliek
1
140
How to automate (nearly) anything
mattijsbliek
0
150
Other Decks in Programming
See All in Programming
Lessons from Spec-Driven Development
simas
PRO
0
220
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.7k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
550
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
120
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
180
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
570
Oxcを導入して開発体験が向上した話
yug1224
4
320
RTSPクライアントを自作してみた話
simotin13
0
620
AIで効率化できた業務・日常
ochtum
0
140
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.4k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Why Our Code Smells
bkeepers
PRO
340
58k
A designer walks into a library…
pauljervisheath
211
24k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Thoughts on Productivity
jonyablonski
76
5.2k
Site-Speed That Sticks
csswizardry
13
1.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
300
Transcript
None
• Oorsprong • Basics • Wat fixt het? BEMBEMBEM
• Koppeling met html • Conflicten in selectors • Onbedoelde
cascades CSS The Bad Parts
• OOCSS (Nicole Sullivan) • Yandex • Nicolas Gallager Russia
to the rescue
None
• Block • Element • Modifier Basics
.cup (block) .cup--glass (modifier) .beer (block)
None
Maar wat fixt het nou?
Vijf problemen uitgelegd voor Real Programmers™
"Ik moet !important gebruiken om dit te overschrijven"
1. Cyclomatic complexity
A quantitative measure of the number of linearly independent paths
through a program's source code.
None
None
Te generiek
None
"Ik heb geen idee waarom deze style wordt toegepast."
2. Composition over inheritance
Ook in CSS kun je beter selectors composen dan laten
overerven
None
None
None
None
"Ik durf dit niet aan te passen want misschien gaan
het ergens anders stuk."
3. Open/Closed principle
Open for extension, closed for modification
Als je veelgebruikte styles aanpast gaat er bijna zeker weten
ergens wat kaduuk
Gateway to hell
None
Op deze manier zijn de nieuwe styles opt-in en weet
je zeker dat er niks breekt
"Deze selector wordt op twintig plekken gebruikt. Waar moet ik
zoeken?"
4. Single source of truth
Welke styles gelden nu voor .cookie? En als ik hier
.cookie aan wil passen, waar moet ik dan zijn?
Hier weet ik exact welke styles applied worden, en waar
ik ze kan vinden
Styles voor .card zitten altijd in card.css Conventie: module ==
file
"Deze selector wordt in wel 20 files gebruikt."
5. Single responsibility principle
Deze button doet een heleboel en kan niet hergebruikt worden.
Nu is de button herbruikbaar en doet elke selector maar
één ding
Tijd voor ACTIE
None
None
None
None
None
None
None
None
None