Last updated 3 years ago
Was this helpful?
⟩ ⟩ ⟩
Google ⟩ Web Component ⟩
⭐️ use CSS variables: CSS variables exist on all levels, both in light and shadow. 📗 JS.info ⟩
<style> fancy-tabs { margin-bottom: 32px; --fancy-tabs-bg: black; <!-- ⭐️ css var --> } </style> <fancy-tabs background>...</fancy-tabs>
/* inside shadow DOM */ :host([background]) { background: var(--fancy-tabs-bg, #9E9E9E); /* ⭐️ css hook */ border-radius: 10px; padding: 10px; }