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
Andres Galante
September 26, 2016
Technology
0
50
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
190
Make Something Great: Become an Open Source Contributor
andresgalante
0
280
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
57
Open source - JUG BA
andresgalante
0
60
Open source - QCon19
andresgalante
0
93
CSS - Media queries o tamanho não importa
andresgalante
0
72
Cosmos
andresgalante
0
93
PatternFly 4 variable system
andresgalante
0
94
Open source
andresgalante
3
80
Other Decks in Technology
See All in Technology
相互運用可能な学修歴クレデンシャルに向けた標準技術と国際動向
fujie
0
230
2025新卒研修・HTML/CSS #弁護士ドットコム
bengo4com
3
13k
Lambda management with ecspresso and Terraform
ijin
2
150
Claude CodeでKiroの仕様駆動開発を実現させるには...
gotalab555
3
960
✨敗北解法コレクション✨〜Expertだった頃に足りなかった知識と技術〜
nanachi
1
650
Claude Codeが働くAI中心の業務システム構築の挑戦―AIエージェント中心の働き方を目指して
os1ma
9
2.2k
反脆弱性(アンチフラジャイル)とデータ基盤構築
cuebic9bic
3
170
【OptimizationNight】数理最適化のラストワンマイルとしてのUIUX
brainpadpr
1
420
生成AI導入の効果を最大化する データ活用戦略
ham0215
0
120
LLM 機能を支える Langfuse / ClickHouse のサーバレス化
yuu26
8
1.1k
ロールが細分化された組織でSREと協働するインフラエンジニアは何をするか? / SRE Lounge #18
kossykinto
0
210
LLMをツールからプラットフォームへ〜Ai Workforceの戦略〜 #BetAIDay
layerx
PRO
1
920
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
332
22k
How STYLIGHT went responsive
nonsquared
100
5.7k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
A designer walks into a library…
pauljervisheath
207
24k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Raft: Consensus for Rubyists
vanstee
140
7.1k
A better future with KSS
kneath
239
17k
Side Projects
sachag
455
43k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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 :)