Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Styling the Shadow Dom
Search
Andres Galante
September 26, 2016
Technology
0
54
Styling the Shadow Dom
Tiangle JS meetup talk about how to style the shadow DOM
Andres Galante
September 26, 2016
Tweet
Share
More Decks by Andres Galante
See All by Andres Galante
Make Something Great! Become an Open Source Contributor
andresgalante
0
210
Make Something Great: Become an Open Source Contributor
andresgalante
0
290
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
66
Open source - JUG BA
andresgalante
0
69
Open source - QCon19
andresgalante
0
100
CSS - Media queries o tamanho não importa
andresgalante
0
81
Cosmos
andresgalante
0
100
PatternFly 4 variable system
andresgalante
0
100
Open source
andresgalante
3
86
Other Decks in Technology
See All in Technology
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
990
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
510
ログ管理の新たな可能性?CloudWatchの新機能をご紹介
ikumi_ono
1
530
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
100
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
430
Noを伝える技術2025: 爆速合意形成のためのNICOフレームワーク速習 #pmconf2025
aki_iinuma
2
2.1k
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
120
因果AIへの招待
sshimizu2006
0
930
世界最速級 memcached 互換サーバー作った
yasukata
0
330
生成AI時代の自動E2Eテスト運用とPlaywright実践知_引持力哉
legalontechnologies
PRO
0
210
チーリンについて
hirotomotaguchi
3
970
最近のLinux普段づかいWaylandデスクトップ元年
penguin2716
1
670
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
For a Future-Friendly Web
brad_frost
180
10k
Thoughts on Productivity
jonyablonski
73
5k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Optimizing for Happiness
mojombo
379
70k
Done Done
chrislema
186
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Automating Front-end Workflow
addyosmani
1371
200k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
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 :)