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
Styling the Shadow Dom
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Andres Galante
September 26, 2016
Technology
58
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Styling the Shadow Dom
Tiangle JS meetup talk about how to style the shadow DOM
Andres Galante
September 26, 2016
More Decks by Andres Galante
See All by Andres Galante
Make Something Great! Become an Open Source Contributor
andresgalante
0
220
Make Something Great: Become an Open Source Contributor
andresgalante
0
310
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
83
Open source - JUG BA
andresgalante
0
82
Open source - QCon19
andresgalante
0
120
CSS - Media queries o tamanho não importa
andresgalante
0
100
Cosmos
andresgalante
0
130
PatternFly 4 variable system
andresgalante
0
110
Open source
andresgalante
3
99
Other Decks in Technology
See All in Technology
どうして今サーバーサイドKotlinを選択したのか
nealle
0
190
AIDLC_ヤフーショッピングの取り組み
lycorptech_jp
PRO
0
510
GitHub Copilot運用のリアル ~AI Credit時代にどう向き合うか~
takafumisu2uk1
0
620
NDIAS CTF 2026 問題解説会資料
bata_24
0
170
RAGの精度向上とエージェント活用
kintotechdev
2
130
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
170
FinOps X 2026 Recap from Engineer Side #JapanFinOps
chacco38
0
250
SRE依存からの脱却 運用を開 発チームへ移す、 フルサイ クル開 発体制の実践
joooee0000
0
100
AIで政治は変わるのか? — 中高生と考えたAI時代の民主主義(東海高校サタデープログラム)
eitarosuda
0
380
ゼロをイチにする仕事が終わったあと
smasato
0
270
はてなのサービス基盤を支える Kubernetes《足腰》
masayoshimaezawa
0
430
AIエージェントとPhysical AIが拓く製造業の変革(ハノーバーメッセリキャップ)
iotcomjpadmin
0
210
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
660
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Designing for humans not robots
tammielis
254
26k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
880
Paper Plane (Part 1)
katiecoart
PRO
0
9.5k
Abbi's Birthday
coloredviolet
3
8.5k
Ruling the World: When Life Gets Gamed
codingconduct
0
270
Accessibility Awareness
sabderemane
1
150
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
30 Presentation Tips
portentint
PRO
1
340
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
620
Transcript
@andresgalante Shadow Dom
None
Shadow Dom
Heads Up
1. Never trust an Argentinean designer writing code.
1. Never trust an Argentinean designer writing code.
2. I am a Shadow Dom rookie
Shadow Dom
Custom elements + Shadow DOM = Self contained HTML, CSS
and JS
None
None
CSS
The Shadow DOM
The ShadowRoot A shadow root is a document fragment that
gets attached to a “host” element.
Light DOM + Shadow DOM = Composed DOM
<slot> Placeholders inside your component that users can fill with
their own markup.
How to style the ShadowDOM
None
None
None
None
None
CSS selectors from the outer page don’t apply inside your
component. Styles defined inside don’t bleed out. They’re scoped to the host element.
:host(<selector>) selector Allows you to target the host if it
matches a <selector>.
::host-context(<selector>) selector Matches the component if it or any of
its ancestors matches <selector>.
:slotted(<compound-selector>) selector Matches nodes that are distributed into a <slot>
Styling a component from the outside.
Style hooks using CSS custom properties CSS variables and mixins
Access Card Demo Putting everything together
None
Can we use it?
maybe
Thanks :)