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
Houdini: Abracadabra CSS
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masaaki Morishita
October 19, 2016
Programming
860
1
Share
Houdini: Abracadabra CSS
at #dogenzakabeerbash
Masaaki Morishita
October 19, 2016
More Decks by Masaaki Morishita
See All by Masaaki Morishita
PostCSS: Build your own CSS processor
morishitter
6
4.7k
Modern CSS: architecture, future specs and build flow
morishitter
13
2.7k
PostCSS and cssnext
morishitter
11
1.8k
PostCSS 5.0: for Custom CSS Preprocessing
morishitter
10
1.2k
PostCSS for beginners
morishitter
6
1.5k
CSSfmt
morishitter
2
240
Introduction to CSS Architecture
morishitter
3
400
Introduction to PostCSS
morishitter
6
1.7k
Yet Another CSS Preprocessor
morishitter
1
5.5k
Other Decks in Programming
See All in Programming
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
2
220
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
160
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
440
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
How Swift's Type System Guides AI Agents
koher
0
190
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
180
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
6k
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.6k
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
140
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
680
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Paper Plane (Part 1)
katiecoart
PRO
0
6.5k
Thoughts on Productivity
jonyablonski
76
5.1k
Side Projects
sachag
455
43k
A designer walks into a library…
pauljervisheath
211
24k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
410
Color Theory Basics | Prateek | Gurzu
gurzu
0
280
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Transcript
Houdini: Abracadabra CSS @morishi(er_
About me .about-me { name: Masaaki Morishita; twitter: @morishitter_; github:
morishitter; qiita: morishitter; specializing-in: CSS; works-at: 'Increments, inc.'; }
Do you love CSS?
CSS is easy :) • ؆୯ͳߏจ • ΧεέʔσΟϯάʢৄࡉɺܧঝʣ .selector {
property: value; } ͜Ε͚ͩ
but, CSS is broken...
CSS is missing ;( • ߏԽ • நԽ • ϧʔϧηοτͷείʔϓ
"Cascading Shit Show" by @fat h"ps:/ /www.youtube.com/watch? v=iniwPUEbPUM
CSS preprocessors? • e.g. Sass, Less, Stylus • ඪ४ٕज़Ͱͳ͍ •
γϯλοΫεγϡΨʔ • PostCSS? • PostCSSͨͩͷύʔαʔ • cssnext ϙϦϑΟϧͰͳ͍
We need polyfils of CSS
but, it's very hard to create
None
None
None
Houdini
Extensible web h"ps:/ /extensiblewebmanifesto.org/
Extensible Web • ϒϥβͷػೳʹΞΫηε͢ΔϨΠϠʔͷAPIΛఏڙ • ༷ͷࡦఆɺϒϥβͷ࣮Λͨͣʹ։ൃऀ࣮Ͱ͖Δ • ༷ͷఏҊʹͭͳ͕Δ • HoudiniͦͷCSSͷͨΊͷͷ
Houdini • Typed OM • Proper-es and Values API •
Pain-ng API • Layout API • Font Metrics API • Parser API • Worklets
Typed OM document.querySelector('#element') .style.opacity = '0.5px'; ↓ document.querySelector('#element') .styleMap.set('opacity', new
CSSNumberValue(0.5)); document.querySelector('#element') .styleMap.get('opacity').value; // 0.5
Typed OM • ࠓ·Ͱ element.style ͷจࣈྻΛ͜Ͷ͘Γճ͚ͩ͢ • styleMap ΦϒδΣΫτͱͷΫϥεΛՃ •
JS͔ΒCSSΛѻ͍͘͢ͳΔ • CanaryͰflagΛONʹ͢Δͱ෦తʹ͑Δ
Proper&es and Values API .foo { --opacity: 1; --opacity: 'foo';
opacity: var(--opacity); /* ແޮͳͳͷͰύʔαʔ͕উखʹআ */ } document.registerProperty({ name: '--my-opacity', syntax: '<number>', // type check inherits: false, // ܧঝͤ͞Δ͔Ͳ͏͔ initialValue: 1 // ॳظ });
Pain%ng API <div id="foo"></div> <style> #foo { --image: url('#url'); background-image:
paint(image-with-placeholder); } </style>
Paint Worklet document.registerProperty({ name: '--image', syntax: '<image>' }); window.paintWorklet.import('paintworklet.js'); registerPaint('image-with-placeholder',
class { static get inputProperties() { return ['--image']; } paint(ctx, geom, properties) { const img = properties.get('--image'); switch (img.state) { // } } })
Paint Worklet • CanvasͷΑ͏ͳͷ • CanvasCPUϝϞϦ৯͏ • CanaryͰflagΛONʹ͢Δͱ෦తʹ͑Δ
Layout API <div id="myElement"> <div> CSS is awesome. </div> </div>
<style> #myElement { display: layout('simple-flow'); } </style>
Layout Worklet registerLayout('simple-flow', class { static get inputProperties() { return
['width', 'height'] } static get childrenInputProperties() { return ['x', 'y', 'position'] } layout(children, constraintSpace, styleMap, breakToken) { // } }
Is Houdini ready yet? h"ps:/ /ishoudinireadyyet.com
Thanks :D @morishi(er_