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
0
57
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
300
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
75
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
94
Other Decks in Technology
See All in Technology
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
130
MCPで決済に楽にする
mu7889yoon
0
160
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
130
GitHub Advanced Security × Defender for Cloudで開発とSecOpsのサイロを超える: コードとクラウドをつなぐ、開発プラットフォームのセキュリティ
yuriemori
1
110
AIにより大幅に強化された AWS Transform Customを触ってみる
0air
0
190
Tour of Agent Protocols: MCP, A2A, AG-UI, A2UI with ADK
meteatamel
0
130
AIエージェント勉強会第3回 エージェンティックAIの時代がやってきた
ymiya55
0
160
CREがSLOを握ると 何が変わるのか
nekomaho
0
280
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
77k
俺の/私の最強アーキテクチャ決定戦開催 ― チームで新しいアーキテクチャに適合していくために / 20260322 Naoki Takahashi
shift_evolve
PRO
1
470
Zephyr(RTOS)でOpenPLCを実装してみた
iotengineer22
0
160
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
260
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
Marketing to machines
jonoalderson
1
5.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
230
WENDY [Excerpt]
tessaabrams
9
37k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
93
How to Ace a Technical Interview
jacobian
281
24k
Skip the Path - Find Your Career Trail
mkilby
1
93
How to Talk to Developers About Accessibility
jct
2
160
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Six Lessons from altMBA
skipperchong
29
4.2k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
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 :)