Skip to content
This repository was archived by the owner on Jun 28, 2021. It is now read-only.
This repository was archived by the owner on Jun 28, 2021. It is now read-only.

MDL in a shadow dom node #466

Open
Open
@brandonmp

Description

@brandonmp

I'm using MDL in a content script for a Chrome Extension. To keep the CSS from bleeding, I'm using a shadowDOM node to limit material.css from leaking into global scope.

However, this seems to break material.js. Specifically, clicking a button no longer works. Looking material.js, it makes frequent use of document.

I tried replacing calls to document with calls to document.querySelector('#shadowroot').shadowRoot (to limit the scope of any DOM manipulation to the shadow DOM), but there are way too many references for tht to work safely.

Has anyone had any success doing this, or any advice? The primary components I need are Tabs and Button.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions