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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mattijs Bliek
July 15, 2016
Programming
46
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
150
Designing in the Future
mattijsbliek
1
140
How to automate (nearly) anything
mattijsbliek
0
150
Other Decks in Programming
See All in Programming
UIの境界線をデザインする | React Tokyo #15 メイントーク
sasagar
2
380
Running Swift without an OS
kishikawakatsumi
0
850
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
110
Road to RubyKaigi: Play Hard(ware)
makicamel
1
480
GoogleCloudとterraform完全に理解した
terisuke
1
160
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
190
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.3k
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
230
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
170
10 Tips of AWS ~Gen AI on AWS~
licux
5
480
Claude Codeをカスタムして自分だけのClaude Codeを作ろう
terisuke
0
150
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
160
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.4k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
AI: The stuff that nobody shows you
jnunemaker
PRO
6
600
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
We Are The Robots
honzajavorek
0
220
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
270
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Exploring anti-patterns in Rails
aemeredith
3
330
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
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