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
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
絵や写真から学ぶ、要素がもたらす副作用
kspace
0
260
AIネイティブスタートアップにおけるプロダクト開発の新常識 / Product Development Tips in AI-Native Startups
saka2jp
2
1.2k
AI時代、デザイナーの価値はどこに?
tararira
2
1k
「使いやすさ」だけでは、「勝てる」サービスにはならない。〜KPIとUXの分断を埋める、サービス戦略という「指針」〜
nbkouhou
2
310
新卒2年目デザイナーが、UX検定基礎にチャレンジした話
designer_no_pon
1
1.4k
アイデアを加速させる!Firefly ボードで発想の幅を広げよう
connecre
1
370
From the Visible Crossroads: Turning Outputs into Outcomes
takaikanako
2
1.4k
Vibe Coding デザインシステム
poteboy
3
1.8k
CULTURE DECK/Creative Director
mhand01
0
1.1k
TWCP#21 UXデザインと哲学のはなし
shinn
0
330
decksh object reference
ajstarks
2
1.6k
AI時代に必要な アイデアの形
uxman
0
150
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Navigating Weather and Climate Data
rabernat
0
160
Ruling the World: When Life Gets Gamed
codingconduct
0
190
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
770
Agile that works and the tools we love
rasmusluckow
331
21k
Scaling GitHub
holman
464
140k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.8k
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]