MCPcopy
hub / github.com/primer/react / readRule

Function readRule

packages/react/src/utils/testing.tsx:123–133  ·  view source on GitHub ↗
(rule: CSSStyleRule, dest: ComputedStyles)

Source from the content-addressed store, hash-verified

121 }
122
123 function readRule(rule: CSSStyleRule, dest: ComputedStyles) {
124 if (matchesSafe(div, rule.selectorText)) {
125 const {style} = rule
126 for (let i = 0; i < style.length; i++) {
127 const prop = style[i]
128 dest[prop] = style.getPropertyValue(prop)
129 }
130 } else {
131 // console.warn('no match:', rule.selectorText)
132 }
133 }
134
135 function readMedia(mediaRule: CSSMediaRule) {
136 const key = `@media ${mediaRule.media[0]}`

Callers 2

getComputedStylesFunction · 0.85
readMediaFunction · 0.85

Calls 1

matchesSafeFunction · 0.85

Tested by

no test coverage detected