Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Resep Rahasia CSS Custom Properties
Search
Yudhi Satrio
June 21, 2020
Programming
2
180
Resep Rahasia CSS Custom Properties
Mengatur strategi dalam menerapkan CSS Variable agar lebih dinamis
Yudhi Satrio
June 21, 2020
Tweet
Share
More Decks by Yudhi Satrio
See All by Yudhi Satrio
Membangun Situs Web yang Ramah Aksesibilitas
isatrio
0
120
Membuka Peluang Karier Internasional
isatrio
0
84
Membuat Tema dan Plugin yang Ramah Pengguna
isatrio
0
25
SEO
isatrio
0
59
Front_End_Developer_Weapons_in_GNOME.pdf
isatrio
0
84
A Healthy Everyday Git Commit
isatrio
0
130
Serba-serbi Menerapkan A11y Dalam Situs Web
isatrio
0
360
Understanding How People with Visual Impairments Using Screen Reader
isatrio
0
32
Assistive Technology Built-in on GNOME
isatrio
0
180
Other Decks in Programming
See All in Programming
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.3k
ゲームの物理 剛体編
fadis
0
370
マスタデータ問題、マイクロサービスでどう解くか
kts
0
120
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
認証・認可の基本を学ぼう前編
kouyuume
0
270
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
3k
GISエンジニアから見たLINKSデータ
nokonoko1203
0
180
Developing static sites with Ruby
okuramasafumi
0
320
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
実は歴史的なアップデートだと思う AWS Interconnect - multicloud
maroon1st
0
250
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
110
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
2
65
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
230
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.4k
Statistics for Hackers
jakevdp
799
230k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
190
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
260
Designing for Timeless Needs
cassininazir
0
93
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
69
A Soul's Torment
seathinner
1
2k
Chasing Engaging Ingredients in Design
codingconduct
0
84
Transcript
https://app.sli.do/event/46fzj4qa
Resep Rahasia CSS Custom Properties Oleh isatrio - CC-by-SA 4.0
license
Selamat datang developer LEMAH yang kalau bikin situs web pakai
Bootstrap -- Pinjem Coki Anwar
CSS itu mudah!
Siapa yang bilang?
CSS itu “TRICKY”!
Saya adalah tim “CSS adalah bahasa pemrograman”
1. CSS enggak punya variabel 2. CSS itu bahasa komputer
untuk menginstruksikan komputer untuk merender gaya
Saya adalah orang pertama yang skeptis dengan variabel css, karena
saya adalah pengguna css-preprocessor
Variabel dari CSS Preprocessor
Assign variabel
https://codepen.io/isatrio/pen/yLeMLPg Hasil kompilasi
CSS Custom Properties Variabel
Assign variabel Nilai bawaan bila nilai variabel kosong Deklarasi nilai
variabel
Implementasi Variabel
None
None
Tidak valid
Invalid Invalid
Valid
None
Preprocessor variabel itu statis
None
Variabel CSS itu dinamis
None
Global dan Lokal
None
Terkadang variabel lokal juga masih perlu diimplementasikan
Mengaduk ramuan variabel statis dengan variabel dinamis
Variabel sass statis Variabel css dinamis Implementasi nilai variabel
“Jangan lakukan pada saat runtime, lakukanlah pada saat mendesain” --
Bill Sourour
None
None
Pisahkan antara desain dan logika
None
None
Jangan mengubah tema warna secara langsung
None
Memperbarui nilai menggunakan JS
None
None
Komponen VueJS https://codepen.io/isatrio/pen/MWKpjar
Referensi 1. Smashing Book 6: New Frontiers In Web Design
Bab “A Strategy Guide to CSS Custom Properties” oleh MIKE RIETHMULLER 2. Using CSS custom properties MDN 3. Don’t do it at runtime. Do it at design time oleh Bill Sourour