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

Function iterateReadyRules

src/inject/dynamic-theme/stylesheet-modifier.ts:332–345  ·  view source on GitHub ↗
(
                group: ReadyGroup,
                target: CSSBuilder,
                styleIterator: (s: ReadyStyleRule, t: CSSBuilder) => void,
            )

Source from the content-addressed store, hash-verified

330 }
331
332 function iterateReadyRules(
333 group: ReadyGroup,
334 target: CSSBuilder,
335 styleIterator: (s: ReadyStyleRule, t: CSSBuilder) => void,
336 ) {
337 group.rules.forEach((r) => {
338 if (r.isGroup) {
339 const t = createTarget(r, target);
340 iterateReadyRules(r, t, styleIterator);
341 } else {
342 styleIterator(r as ReadyStyleRule, target);
343 }
344 });
345 }
346
347 iterateReadyRules(rootReadyGroup, sheet, (rule, target) => {
348 const index = target.cssRules.length;

Callers 1

buildStyleSheetFunction · 0.85

Calls 1

createTargetFunction · 0.85

Tested by

no test coverage detected