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
49
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
280
How to use CSS to make your App look amazing and be accessible on any device
andresgalante
0
52
Open source - JUG BA
andresgalante
0
57
Open source - QCon19
andresgalante
0
89
CSS - Media queries o tamanho não importa
andresgalante
0
68
Cosmos
andresgalante
0
92
PatternFly 4 variable system
andresgalante
0
94
Open source
andresgalante
3
80
Other Decks in Technology
See All in Technology
自分を理解するAI時代の準備 〜マイプロフィールMCPの実装〜
edo_m18
0
110
上長や社内ステークホルダーに対する解像度を上げて、より良い補完関係を築く方法 / How-to-increase-resolution-and-build-better-complementary-relationships-with-your-bosses-and-internal-stakeholders
madoxten
13
7.7k
Long journey of Continuous Delivery at Mercari
hisaharu
1
210
“プロダクトを好きになれるか“も QAエンジニア転職の大事な判断基準だと思ったの
tomodakengo
0
140
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
6.4k
New Cache Hierarchy for Container Images and OCI Artifacts in Kubernetes Clusters using Containerd / KubeCon + CloudNativeCon Japan
pfn
PRO
0
150
Snowflake Intelligenceで実現できるノーコードAI活用
takumimukaiyama
1
230
開発効率と信頼性を両立する Ubieのプラットフォームエンジニアリング
teru0x1
0
140
生成AIをテストプロセスに活用し"よう"としている話 #jasstnano
makky_tyuyan
0
170
堅牢な認証基盤の実現 TypeScriptで代数的データ型を活用する
kakehashi
PRO
2
220
"SaaS is Dead" は本当か!? 生成AI時代の医療 Vertical SaaS のリアル
kakehashi
PRO
3
210
ユーザーのプロフィールデータを活用した推薦精度向上の取り組み
yudai00
0
360
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
299
21k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Being A Developer After 40
akosma
90
590k
Agile that works and the tools we love
rasmusluckow
329
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Six Lessons from altMBA
skipperchong
28
3.8k
Fireside Chat
paigeccino
37
3.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
480
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.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 :)