MCPcopy
hub / github.com/bubkoo/html-to-image / embedProp

Function embedProp

src/embed-images.ts:7–23  ·  view source on GitHub ↗
(
  propName: string,
  node: HTMLElement,
  options: Options,
)

Source from the content-addressed store, hash-verified

5import { getMimeType } from './mimes'
6
7async function embedProp(
8 propName: string,
9 node: HTMLElement,
10 options: Options,
11) {
12 const propValue = node.style?.getPropertyValue(propName)
13 if (propValue) {
14 const cssString = await embedResources(propValue, null, options)
15 node.style.setProperty(
16 propName,
17 cssString,
18 node.style.getPropertyPriority(propName),
19 )
20 return true
21 }
22 return false
23}
24
25async function embedBackground<T extends HTMLElement>(
26 clonedNode: T,

Callers 1

embedBackgroundFunction · 0.85

Calls 1

embedResourcesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…