MCPcopy Create free account
hub / github.com/darkreader/darkreader / createShadowStaticStyleOverrides

Function createShadowStaticStyleOverrides

src/inject/dynamic-theme/index.ts:298–307  ·  view source on GitHub ↗
(root: ShadowRoot)

Source from the content-addressed store, hash-verified

296}
297
298function createShadowStaticStyleOverrides(root: ShadowRoot) {
299 // The shadow DOM may not be populated yet and the custom element implementation
300 // may assume that unpopulated shadow root is empty and inadvertently remove
301 // Dark Reader's overrides
302 const delayed = root.firstChild === null;
303 createShadowStaticStyleOverridesInner(root);
304 if (delayed) {
305 delayedCreateShadowStaticStyleOverrides(root);
306 }
307}
308
309function replaceCSSTemplates($cssText: string) {
310 return $cssText.replace(/\${(.+?)}/g, (_, $color) => {

Callers 2

watchForUpdatesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…