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
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
70
Open source - JUG BA
andresgalante
0
72
Open source - QCon19
andresgalante
0
110
CSS - Media queries o tamanho não importa
andresgalante
0
83
Cosmos
andresgalante
0
110
PatternFly 4 variable system
andresgalante
0
110
Open source
andresgalante
3
88
Other Decks in Technology
See All in Technology
2025年のデザインシステムとAI 活用を振り返る
leveragestech
0
680
I tried making a solo advent calendar!
zzzzico
0
130
AWSと生成AIで学ぶ!実行計画の読み解き方とSQLチューニングの実践
yakumo
2
170
人工知能のための哲学塾 ニューロフィロソフィ篇 第零夜 「ニューロフィロソフィとは何か?」
miyayou
0
340
あの夜、私たちは「人間」に戻った。 ── 災害ユートピア、贈与、そしてアジャイルの再構築 / 20260108 Hiromitsu Akiba
shift_evolve
PRO
0
370
自己管理型チームと個人のセルフマネジメント 〜モチベーション編〜
kakehashi
PRO
5
1.7k
20251225_たのしい出張報告&IgniteRecap!
ponponmikankan
0
110
モノタロウ x クリエーションラインで実現する チームトポロジーにおける プラットフォームチーム・ ストリームアラインドチームの 効果的なコラボレーション
creationline
0
350
国井さんにPurview の話を聞く会
sophiakunii
1
300
Claude Codeを使った情報整理術
knishioka
19
12k
善意の活動は、なぜ続かなくなるのか ーふりかえりが"構造を変える判断"になった半年間ー
matsukurou
0
220
小さく、早く、可能性を多産する。生成AIプロジェクト / prAIrie-dog
visional_engineering_and_design
0
320
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
180
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
51
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
100
Large-scale JavaScript Application Architecture
addyosmani
515
110k
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
390
KATA
mclloyd
PRO
33
15k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
410
Abbi's Birthday
coloredviolet
0
4.2k
Designing Powerful Visuals for Engaging Learning
tmiket
0
190
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 :)