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
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
69
Other Decks in Design
See All in Design
The ISO 25964 standard on Information and documentation — Thesauri and interoperability with other vocabularies
accessinnovations
0
260
もっともらしさ生成器と暮らす – AI懐疑派の試行錯誤
sekiguchiy
0
200
作品が生まれ続けるコミュニティデザイン ― 研究室でも会社でもないサードプレイス ― / designship26-iwaken
iwaken71
0
140
【CEDEC2026】『Shadowverse: Worlds Beyond』続編開発におけるUIデザイン・アニメーション演出の「超進化」 ~継承と挑戦を両立するデザイン手法~
cygames
PRO
4
5.4k
みんながデザインを担う組織へ。急加速する開発組織でのデザイナーの戦略
mukai_takeru
0
320
【Designship2026】「社内受託中心部署」から、事業とカルチャーを動かすデザイン組織へ
sugiyama_sukedachi
0
130
Webブラウザで動く VJツールをつくる
akirafukuoka
0
120
“なんとなくFigma”から一歩先へ。AI時代も活きるWeb制作フロー
ayumidesign
0
260
プレゼンスライド作成で意識していること
kimichan
0
140
JBUG大阪#9_登壇資料_引き継ぎで困らないためのBacklogWikiの整え方_ミスと属人化を防ぐために、 “次の人が動ける状態”をどう残すか
webnaut
2
290
RawrXD: The Sword
seanvraj_arts
0
180
個人理念(自分の言葉)の言語化ワークショップ
kakukoki
1
410
Featured
See All Featured
KATA
mclloyd
PRO
35
16k
Building Applications with DynamoDB
mza
96
7.2k
Chasing Engaging Ingredients in Design
codingconduct
0
360
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Exploring anti-patterns in Rails
aemeredith
4
540
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
620
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
How GitHub (no longer) Works
holman
316
150k
WENDY [Excerpt]
tessaabrams
14
40k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
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]