Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Naming CSS Stuff is Really Hard
Search
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
69
Other Decks in Design
See All in Design
日経電子版を支えていく Kasane Design System
taitotnk
0
330
組織で働く大人が「知らないままにやってみる」を取り戻す方法とその意味〜企業で働く実務家による実践知の言語化を事例とした考察〜
chiemitaki
1
400
2026/6/26 第6回韓日リビングラボネットワークフォーラムin世宗 ー未来を作るリビングラボー アジアの社会システム転換に向けたリビングラボの可能性
a2k
2
110
速く作れるかではなく、速く学べるか ― 学習ループを回すパイロットの途中報告
nagata03
0
660
A Corrida Maluca - Comedy Storyboard
gioli
0
120
工房としてのAI ── デザイナー、作家、ビルダー
hiranotomoki
0
460
つくり方を変えていく | change-how-we-build
mottox2
2
1.5k
少人数チームで_使われるプロダクトにたどり着くための_デザインハーネス.pdf
nishame
1
1.5k
改正JISを見据えた、企業のアクセシビリティ対応ロードマップ
securecat
1
450
AVI 2026 Keynote "Vision-Driven Design"
ishii_mit
0
140
JBUG大阪#9_登壇資料_引き継ぎで困らないためのBacklogWikiの整え方_ミスと属人化を防ぐために、 “次の人が動ける状態”をどう残すか
webnaut
2
250
Decksh keywords
ajstarks
0
130
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
First, design no harm
axbom
PRO
2
1.3k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Docker and Python
trallard
47
4.2k
Facilitating Awesome Meetings
lara
57
7.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
990
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
The Curse of the Amulet
leimatthew05
3
14k
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]