Home > Blockchain >  What exactly are the css boundaries in web components?
What exactly are the css boundaries in web components?

Time:02-03

<html>
  <style>
    body { color: blue; }
  </style>
  <body>
    <h1>Styles!</h1>
    <p>somebody made a very broad selector</p>
    <isolated-stuff></isolated-stuff>
  </body>
  <script>
    class DemoElement extends HTMLElement {
      constructor() {
        super();
        this.attachShadow({ mode: 'open' });
        this.shadowRoot.innerHTML = `
        <style>div { font-size: 24px; }</style> // I can add `color: initial` here            
  •  Tags:  
  • Related