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
Resep Rahasia CSS Custom Properties
Search
Yudhi Satrio
June 21, 2020
Programming
190
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Resep Rahasia CSS Custom Properties
Mengatur strategi dalam menerapkan CSS Variable agar lebih dinamis
Yudhi Satrio
June 21, 2020
More Decks by Yudhi Satrio
See All by Yudhi Satrio
Membangun Situs Web yang Ramah Aksesibilitas
isatrio
0
130
Membuka Peluang Karier Internasional
isatrio
0
95
Membuat Tema dan Plugin yang Ramah Pengguna
isatrio
0
33
SEO
isatrio
0
66
Front_End_Developer_Weapons_in_GNOME.pdf
isatrio
0
91
A Healthy Everyday Git Commit
isatrio
0
140
Serba-serbi Menerapkan A11y Dalam Situs Web
isatrio
0
380
Understanding How People with Visual Impairments Using Screen Reader
isatrio
0
50
Assistive Technology Built-in on GNOME
isatrio
0
240
Other Decks in Programming
See All in Programming
Are APIs Still Relevant in the AI Era?
soyuka
0
140
Java 27新機能 / Java 27 new features
kishida
2
130
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
550
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
550
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
150
Intent as Code
shoppingjaws
6
990
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
190
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
310
A2UI for Android: Safely Rendering AI-Generated UI with Jetpack Compose - DroidKaigi 2026
itsmedreamwalker
0
130
Go のフラットな パッケージに 「ファイル単位の private」を 〜Linter “declscope” を作った話〜
mpyw
0
280
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
540
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
240
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
520
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
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