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
47
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
270
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
46
Open source - JUG BA
andresgalante
0
56
Open source - QCon19
andresgalante
0
85
CSS - Media queries o tamanho não importa
andresgalante
0
60
Cosmos
andresgalante
0
90
PatternFly 4 variable system
andresgalante
0
90
Open source
andresgalante
3
79
Other Decks in Technology
See All in Technology
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.3k
Tech Blogを書きやすい環境づくり
lycorptech_jp
PRO
1
240
データマネジメントのトレードオフに立ち向かう
ikkimiyazaki
6
840
Nekko Cloud、 これまでとこれから ~学生サークルが作る、 小さなクラウド
logica0419
2
950
表現を育てる
kiyou77
1
210
速くて安いWebサイトを作る
nishiharatsubasa
10
12k
アジャイル開発とスクラム
araihara
0
170
5分で紹介する生成AIエージェントとAmazon Bedrock Agents / 5-minutes introduction to generative AI agents and Amazon Bedrock Agents
hideakiaoyagi
0
240
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
2k
現場で役立つAPIデザイン
nagix
32
12k
白金鉱業Meetup Vol.17_あるデータサイエンティストのデータマネジメントとの向き合い方
brainpadpr
5
600
ハッキングの世界に迫る~攻撃者の思考で考えるセキュリティ~
nomizone
13
5.1k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
182
22k
Visualization
eitanlees
146
15k
Agile that works and the tools we love
rasmusluckow
328
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
KATA
mclloyd
29
14k
Speed Design
sergeychernyshev
27
790
The Pragmatic Product Professional
lauravandoore
32
6.4k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Site-Speed That Sticks
csswizardry
4
380
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
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 :)