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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
72
Open source - JUG BA
andresgalante
0
77
Open source - QCon19
andresgalante
0
110
CSS - Media queries o tamanho não importa
andresgalante
0
86
Cosmos
andresgalante
0
110
PatternFly 4 variable system
andresgalante
0
110
Open source
andresgalante
3
90
Other Decks in Technology
See All in Technology
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
190
Webhook best practices for rock solid and resilient deployments
glaforge
2
300
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
580
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
240
生成AIを活用した音声文字起こしシステムの2つの構築パターンについて
miu_crescent
PRO
2
210
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.5k
Cosmos World Foundation Model Platform for Physical AI
takmin
0
930
20260204_Midosuji_Tech
takuyay0ne
1
160
モダンUIでフルサーバーレスなAIエージェントをAmplifyとCDKでサクッとデプロイしよう
minorun365
4
210
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
940
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
Tell your own story through comics
letsgokoyo
1
810
Statistics for Hackers
jakevdp
799
230k
The Language of Interfaces
destraynor
162
26k
Six Lessons from altMBA
skipperchong
29
4.1k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Building Adaptive Systems
keathley
44
2.9k
Exploring anti-patterns in Rails
aemeredith
2
250
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The browser strikes back
jonoalderson
0
390
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
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 :)