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
Naming CSS Stuff is Really Hard
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ethan Muller
May 20, 2014
Design
200
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Naming CSS Stuff is Really Hard
Lightning talk for Dayton Clean Coders, 05/25/2014
Ethan Muller
May 20, 2014
More Decks by Ethan Muller
See All by Ethan Muller
Classifying Class Names
ethanmuller
2
160
Frontend Tooling @ Madison+ UX 2014
ethanmuller
1
65
Other Decks in Design
See All in Design
コムデマネージャーがプロダクトデザインに挑戦した。むずかしくて楽しかった。
payatsusan213
0
320
2026年の勢い / Momentum for 2026
bebe
0
460
Storyboard Assignment: Storyboard from Comic Strip
lynteo
3
280
研修担当者が一番伸びた 熊本市役所✕AI『泥臭いAI研修』のワークショップ設計について
garyuten
2
400
新卒2年目デザイナーが、UX検定基礎にチャレンジした話
designer_no_pon
1
1.5k
2026の目標「もっと定量的に事業、会社へ貢献する!」
yuri_ohashi
0
840
Drawing for Animation
lynteo
2
300
UI/UX & Web Design Portfolio 2025|Madoka Kumagai
madoka_portfolio
4
250
体験負債を資産に変える組織的アプローチ
hikarutakase
0
1.4k
「使いやすさ」だけでは、「勝てる」サービスにはならない。〜KPIとUXの分断を埋める、サービス戦略という「指針」〜
nbkouhou
2
410
デザインとフロントエンドの境界が融ける Claude Code × Figma
littlebusters
1
3k
「デザイン」の自分ごと化から始める、デザインピープルのふるまい
mewmo
0
260
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
3.5k
Docker and Python
trallard
47
3.9k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
190
What's in a price? How to price your products and services
michaelherold
247
13k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
310
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
Code Review Best Practice
trishagee
74
20k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
Deep Space Network (abreviated)
tonyrice
0
170
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Transcript
@ethanmuller NAMING CSS STUFF IS REALLY HARD
SECTION 1: NAMING CSS STUFF IS REALLY EASY
<div class=“butts”>lol</div>
There are no rules.
/* help me */
SECTION 2: STRONG LINKS
.class-names are the links between {styles} and <elements>
“This element is styled this way because it is ________”
“This element is styled this way because it is ________”
(insert class name here)
If saying this makes sense, you’ve got a strong link.
None
Strong links make for comprehendible, maintainable code
SECTION 3: THE THREE BIG CATEGORIES
Logical Presentational Content-based
THE THREE BIG CATEGORIES LOGICAL .negative-button! ! .important-heading! ! .subtle-text
THE THREE BIG CATEGORIES LOGICAL ‣ Styles are being applied
for a reason ‣ The best option ‣ Usually not possible
THE THREE BIG CATEGORIES PRESENTATIONAL .big-text! ! .blue-button! ! .round-corners!
! .inset-box
THE THREE BIG CATEGORIES PRESENTATIONAL ‣ Names describe the appearance
of elements ‣ Names are self-describing ‣ Presentation changes require markup changes ‣ Conducive to style reuse
THE THREE BIG CATEGORIES CONTENT-BASED .product-photo! ! .submit-button! ! .contact-name!
! .intro-text
THE THREE BIG CATEGORIES CONTENT-BASED ‣ Names are based on
the content they’re styling ‣ Change presentation without touching markup ‣ Difficult to reuse styles ‣ Lots and lots of names ‣ Requires reading the stylesheet
Experts agree: Logical styles are best.
The problem is, Design ain’t always logical.
Logical Presentational Content-based
Let’s lay down a rule.
RULE-O-THUMB: The larger the project, the worse idea content- based
classes are.
Let’s think of more rules.
THANKS! @ethanmuller
[email protected]