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
59
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
220
Make Something Great: Become an Open Source Contributor
andresgalante
0
310
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
88
Open source - JUG BA
andresgalante
0
84
Open source - QCon19
andresgalante
0
120
CSS - Media queries o tamanho não importa
andresgalante
0
110
Cosmos
andresgalante
0
130
PatternFly 4 variable system
andresgalante
0
120
Open source
andresgalante
3
99
Other Decks in Technology
See All in Technology
AI時代に、人は何を、どう学ぶのか #pbl_pub / What and How Do We Learn in the AI Era?
takaking22
1
250
AI駆動開発はどこまで来たのか? ファインディの最新実態調査で読み解く現在地 Devin Con Tokyo
akiratom
1
510
Kiro WebとCloud Sessions
nagisa53
2
190
三人寄ればチューリング完全
puhitaku
6
3.1k
2027年のMetricKit
kantacky
0
170
NANDでも描画したい!
nichica906
3
680
LLM Internals: 언어 모델의 계보와 알고리즘 진화 (2023~2026)
inureyes
PRO
1
920
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
12
85k
EUDIWの枠組みを出発点に民間エコシステムの在り方を考える(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
110
AIで変わるエンジニアの働き方(仮)
naoinaoi
0
510
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
110
Go 1.27 の標準パッケージに uuid が入った!のでいろいろ喋る / go_127_std_go_uuid
convto
3
700
Featured
See All Featured
Leo the Paperboy
mayatellez
8
2.2k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Practical Orchestrator
shlominoach
191
12k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Google's AI Overviews - The New Search
badams
0
1.1k
Designing Powerful Visuals for Engaging Learning
tmiket
1
510
Claude Code のすすめ
schroneko
67
230k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
300
Between Models and Reality
mayunak
4
400
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Raft: Consensus for Rubyists
vanstee
141
7.6k
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 :)