Day 60: the ::part() pseudo-element

from blog Manuel Matuzović - Blog, | ↗ original
↗ original
You can use the ::part CSS pseudo-element to style an element within a shadow tree.Let's have a look at the following web component. There's a heading and a paragraph in the shadow DOM and we can pass content via light DOM. class NewsTeasers extends HTMLElement { constructor() { super(); this.attachShadow({mode: 'open'}); ...