MCPcopy Index your code
hub / github.com/darkreader/darkreader / addStaticCSS

Function addStaticCSS

src/inject/dynamic-theme/css-collection.ts:45–52  ·  view source on GitHub ↗
(selector: string, comment: string)

Source from the content-addressed store, hash-verified

43 const css = [banner];
44
45 function addStaticCSS(selector: string, comment: string) {
46 const staticStyle = document.querySelector(selector);
47 if (staticStyle && staticStyle.textContent) {
48 css.push(`/* ${comment} */`);
49 css.push(staticStyle.textContent);
50 css.push('');
51 }
52 }
53
54 addStaticCSS('.darkreader--fallback', 'Fallback Style');
55 addStaticCSS('.darkreader--user-agent', 'User-Agent Style');

Callers 1

collectCSSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected