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
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
68
Other Decks in Design
See All in Design
CULTURE DECK/Frontend Engineer
mhand01
0
1.6k
Figma MCPを活用するためのデザインハンドブック
vivion
8
20k
個人理念(自分の言葉)の言語化ワークショップ
kakukoki
1
180
Jun Wei Portfolio 2026
wjw100788
PRO
1
200
明日から真似できる、AIでデザインシステムを活用する方法
vivion
0
150
デザインツールを開く前に その画面は誰に何と言わせたい?受託UIデザイナーが顧客解像度を高める 「打ち合わせの場での確かめ方」
garyuten
1
170
広い関与の可能性に どう向き合うのか? 私たちは。|Timee MarketingDesign 2026-06-18
bebe
0
700
(2026 FlowCon Keynote) Sociotechnical Architecture Finding Flow
xinyao
0
110
root COMPANY DECK / We are hiring!
root_recruit
4
30k
体験負債を資産に変える組織的アプローチ
hikarutakase
0
1.6k
Saving_the_King_-_Storyboard.pdf
terencebasart
0
270
空間アプリ開発のフィードバックをCodexにするための抽象的なデザインツールの模索
karad
0
170
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Mobile First: as difficult as doing things right
swwweet
225
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
New Earth Scene 8
popppiees
3
2.5k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
300
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Everyday Curiosity
cassininazir
0
290
How to Talk to Developers About Accessibility
jct
2
520
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]