MCPcopy Create free account
hub / github.com/weaveworks/scope / explicitlySetStyle

Function explicitlySetStyle

client/app/scripts/utils/file-utils.js:18–29  ·  view source on GitHub ↗
(element, targetEl)

Source from the content-addressed store, hash-verified

16
17function setInlineStyles(svg, target, emptySvgDeclarationComputed) {
18 function explicitlySetStyle(element, targetEl) {
19 const cSSStyleDeclarationComputed = getComputedStyle(element);
20 let computedStyleStr = '';
21 each(cSSStyleDeclarationComputed, (key) => {
22 const value = cSSStyleDeclarationComputed.getPropertyValue(key);
23 if (value !== emptySvgDeclarationComputed.getPropertyValue(key) && !cssSkipValues[value]) {
24 computedStyleStr += `${key}:${value};`;
25 }
26 });
27 targetEl.setAttribute('style', computedStyleStr);
28 targetEl.removeAttribute('data-reactid');
29 }
30
31 function traverse(obj) {
32 const tree = [];

Callers 1

setInlineStylesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…