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
58
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
84
Open source - JUG BA
andresgalante
0
82
Open source - QCon19
andresgalante
0
120
CSS - Media queries o tamanho não importa
andresgalante
0
100
Cosmos
andresgalante
0
130
PatternFly 4 variable system
andresgalante
0
110
Open source
andresgalante
3
99
Other Decks in Technology
See All in Technology
AIQAのナレッジ構築について
qatonchan
1
130
AI研修(Day1)【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
2.7k
Claude Code並行開発環境の ムダ‧ムラ‧ムリを見直した話
muranakaaa
0
320
QAと開発の両側から進める AI活用 -QAプロセスAI支援ツールキットと Inner Loop / Outer Loopの取り組み-
legalontechnologies
PRO
2
370
AIがAPIを書く時代に、私たちは何を設計すべきか
nagix
0
160
NetBoxを利用した作業効率化の試み_NetDevNight4
tnoha
0
370
データ組織の転換期 一足飛びしない段階的戦略
leveragestech
PRO
0
110
A Bag-of-Documents Model for Query Specificity
dtunkelang
0
170
全社でのソフトウェアサプライチェーン攻撃対策をやってみた with Takumi Guard
z63d
0
330
新しい SLO が良い感じにハマっている話
z63d
0
180
データベース研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
680
「休む」重要さ
smt7174
7
1.8k
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
230
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
420
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
470
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
380
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Faster Mobile Websites
deanohume
310
32k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Balancing Empowerment & Direction
lara
6
1.2k
BBQ
matthewcrist
89
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
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 :)