MCPcopy Index your code
hub / github.com/bernaferrari/FigmaToCode / htmlWrapSVG

Function htmlWrapSVG

packages/backend/src/html/htmlMain.ts:430–445  ·  view source on GitHub ↗
(
  node: AltNode<SceneNode>,
  settings: HTMLSettings,
)

Source from the content-addressed store, hash-verified

428};
429
430const htmlWrapSVG = (
431 node: AltNode<SceneNode>,
432 settings: HTMLSettings,
433): string => {
434 if (node.svg === "") return "";
435
436 const builder = new HtmlDefaultBuilder(node, settings)
437 .addData("svg-wrapper")
438 .position();
439
440 // The SVG content already has the var() references, so we don't need
441 // to add inline CSS variables in most cases. The browser will use the fallbacks
442 // if the variables aren't defined in the CSS.
443
444 return `\n<div${builder.build()}>\n${indentString(node.svg ?? "")}</div>`;
445};
446
447const htmlGroup = async (
448 node: GroupNode,

Callers 1

convertNodeFunction · 0.85

Calls 4

indentStringFunction · 0.90
positionMethod · 0.45
addDataMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected