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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Mattijs Bliek
July 15, 2016
Programming
48
0
Share
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
Moments When Things Go Wrong
aurimas
3
130
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
220
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
250
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
11k
AI開発を加速するためにテスト戦略を言語化した
yoshihiro_shu
0
110
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
100
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.5k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
1k
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.4k
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.2k
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
430
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
120
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
Leo the Paperboy
mayatellez
7
1.8k
Utilizing Notion as your number one productivity tool
mfonobong
4
310
The Spectacular Lies of Maps
axbom
PRO
1
780
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
130
Claude Code のすすめ
schroneko
67
220k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
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