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
The purification of web development
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nicolas Gallagher
May 30, 2013
Programming
620
5
Share
The purification of web development
Nicolas Gallagher
May 30, 2013
More Decks by Nicolas Gallagher
See All by Nicolas Gallagher
React Native for web and beyond
necolas
5
1k
Thinking beyond "Scalable CSS"
necolas
14
7k
Making Twitter UI Infrastructure
necolas
14
4.3k
Adaptation and Components
necolas
6
1.4k
CSS Application Architecture
necolas
15
610
HTML5 Boilerplate: past, present, and future
necolas
4
300
Other Decks in Programming
See All in Programming
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
0
190
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
850
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
500
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
150
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
0
160
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
120
Back to the roots of date
jinroq
0
870
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
570
Marketing to machines
jonoalderson
1
5.3k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
170
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
54
Building an army of robots
kneath
306
46k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Utilizing Notion as your number one productivity tool
mfonobong
4
300
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
Technical Leadership for Architectural Decision Making
baasie
3
370
Transcript
The purification of web development
Nicolas Gallagher @necolas
Before code…
Assumptions and the history of ideas
Heraclitus (535 BC – 475 BC)
None
Democritus (460 BC – 370 BC)
None
None
“You cannot step twice into the same river; for fresh
waters are flowing in upon you.” – Heraclitus
CSS and the purification of HTML
<table> <tr> <td align="left" onClick="dothing()"> <center> <font face="verdana">…</font> </center> </td>
</tr> </table>
“To increase the granularity of control over elements, a new
attribute has been added to HTML: 'CLASS'.” - CSS1 spec
None
Don’t use “unsemantic” class names?
“Your HTML, like diamonds, should be forever.” - camendesign.com
“…authors are encouraged to use [class attribute] values that describe
the nature of the content, rather than values that describe the desired presentation of the content.” - HTML5 spec
“A structure based on CLASS is only useful within a
restricted domain, where the meaning of a class has been mutually agreed upon.” - CSS1 spec
Class names are for us, not machines
We can pick our own meaning
Don't write ugly class names?
<p class="hyphens-as-word-separators"> … </p>
/* Component */ .button {…} /* Component */ .button-group {…}
/* Component modifier */ .button.primary {…} /* Component child */ .button-group .item {…}
/* Component */ .Button {…} /* Component modifier */ .Button--primary
{…} /* Component */ .ButtonGroup {…} /* Component descendant */ .ButtonGroup-item {…}
<!-- HTML --> <ul class="ButtonGroup"> <li class="ButtonGroup-item"> <button class="Button"> Save
</button> </li> <li class="ButtonGroup-item"> <button class="Button Button--cancel"> Cancel </button> </li> </ul>
None
github.com/necolas/suit-button-group
github.com/necolas/suit
Structured class names are useful
Don’t use extra elements?
<article class="Box"> <div class="Box-close"> <button class="u-textLike js-close"> <span class="Icon Icon--close"></span>
<span class="u-isHiddenVisually"> Close </span> </button> </div> ... </article>
<article class="Box"> <div class="Box-close"> {{> partials/close-button }} </div> {{$content}}{{/content}} </article>
{{<box_with_close}} {{$content}} <h1>Title</h1> <p>Some words</p> {{/content}} {{/box_with_close}}
Look at what they make you give
Web Components
“Web Components…let web application authors define widgets with a level
of visual richness not possible with CSS alone” - W3C Introduction to Web Components
“…specify the extra presentation using markup…” - W3C Introduction to
Web Components
None
Encapsulation, interoperability, reuse
Shadow DOM Encapsulation and DOM boundaries <element> Custom elements; extend
native elements <template> Clonable, inert DOM fragments
<element extends="button" name="x-btnClose"> <template> <style> @host { /* css to
unstyle button */ } .visHidden { /* css to hide text */ } </style> <x-icon type="close" size="24"></x-icon> <div class="visHidden"> <content></content> </div> </template> <script>// javascript</script> </element>
<button is="x-btnClose">Close</button>
None
It’s ok to rely on extra elements
Step back into the river
The end