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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yudhi Satrio
June 21, 2020
Programming
200
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
Transcript
43 slides
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
More Decks by Yudhi Satrio
See All by Yudhi Satrio
Basic Git - Contribution to Hacktoberfest
isatrio
0
34
Membangun Situs Web yang Ramah Aksesibilitas
isatrio
0
140
Membuka Peluang Karier Internasional
isatrio
0
110
Membuat Tema dan Plugin yang Ramah Pengguna
isatrio
0
40
SEO
isatrio
0
72
Front_End_Developer_Weapons_in_GNOME.pdf
isatrio
0
98
A Healthy Everyday Git Commit
isatrio
0
150
Serba-serbi Menerapkan A11y Dalam Situs Web
isatrio
0
380
Understanding How People with Visual Impairments Using Screen Reader
isatrio
0
61
Other Decks in Programming
See All in Programming
AIコーディングをセッションで終わらせない: PHPライブラリ開発におけるコンテキスト承継設計
ickx
0
110
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
340
LLM 101
dalinaum
0
540
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
230
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
150
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
450
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
はじめてのPLATEAU
nokonoko1203
1
670
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
310
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
400
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
143
7.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
Believing is Seeing
oripsolob
1
290
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Building AI with AI
inesmontani
PRO
1
1.4k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
6
970
The Cult of Friendly URLs
andyhume
79
7.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Designing Powerful Visuals for Engaging Learning
tmiket
1
660