Skip to content

Commit

Permalink
Enhance: add a css insertion case to shadow dom (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonghakseo authored Dec 2, 2023
1 parent f170068 commit 7aca5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/content/ui/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createRoot } from 'react-dom/client';
import App from '@pages/content/ui/app';
import refreshOnUpdate from 'virtual:reload-on-update-in-view';
import injectedStyle from './injected.css?inline';

refreshOnUpdate('pages/content');

Expand All @@ -15,6 +16,11 @@ rootIntoShadow.id = 'shadow-root';
const shadowRoot = root.attachShadow({ mode: 'open' });
shadowRoot.appendChild(rootIntoShadow);

/** Inject styles into shadow dom */
const styleElement = document.createElement('style');
styleElement.innerHTML = injectedStyle;
shadowRoot.appendChild(styleElement);

/**
* https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/pull/174
*
Expand Down
Empty file.

0 comments on commit 7aca5c6

Please sign in to comment.