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
58
0
Share
Styling the Shadow Dom
Tiangle JS meetup talk about how to style the shadow DOM
Andres Galante
September 26, 2016
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
300
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
76
Open source - JUG BA
andresgalante
0
81
Open source - QCon19
andresgalante
0
120
CSS - Media queries o tamanho não importa
andresgalante
0
95
Cosmos
andresgalante
0
120
PatternFly 4 variable system
andresgalante
0
110
Open source
andresgalante
3
98
Other Decks in Technology
See All in Technology
MLOps導入のための組織作りの第一歩
akasan
0
360
小説執筆のハーネスエンジニアリング
yoshitetsu
0
770
Arcana: Production-Ready RAG in Elixir @ ElixirConf EU 2026
georgeguimaraes
0
110
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
480
Percolatorを廃止し、マルチ検索サービスへ刷新した話 / Search Engineering Tech Talk 2026 Spring
visional_engineering_and_design
0
140
Pure Intonation on Browser: Building a Sequencer with Ruby
nagachika
0
150
今年注目する!データ分析プラットフォームでのAIの活用
nayuts
0
150
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
1.5k
ハーネスエンジニアリングをやりすぎた話 ~そのハーネスは解体された~
gotalab555
5
1.8k
The Journey of Box Building
tagomoris
4
3.4k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
79k
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
8
2.3k
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.6k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
890
Chasing Engaging Ingredients in Design
codingconduct
0
170
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Abbi's Birthday
coloredviolet
2
7.2k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
680
Large-scale JavaScript Application Architecture
addyosmani
515
110k
ラッコキーワード サービス紹介資料
rakko
1
3.1M
The Curse of the Amulet
leimatthew05
1
11k
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 :)