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

Function tailwindGroup

packages/backend/src/tailwind/tailwindMain.ts:104–125  ·  view source on GitHub ↗
(
  node: GroupNode,
  settings: TailwindSettings,
)

Source from the content-addressed store, hash-verified

102};
103
104const tailwindGroup = async (
105 node: GroupNode,
106 settings: TailwindSettings,
107): Promise<string> => {
108 // Ignore the view when size is zero or less or if there are no children
109 if (node.width < 0 || node.height <= 0 || node.children.length === 0) {
110 return "";
111 }
112
113 const builder = new TailwindDefaultBuilder(node, settings)
114 .blend()
115 .size()
116 .position();
117
118 if (builder.attributes || builder.style) {
119 const attr = builder.build("");
120 const generator = await tailwindWidgetGenerator(node.children, settings);
121 return `\n<div${attr}>${indentString(generator)}\n</div>`;
122 }
123
124 return await tailwindWidgetGenerator(node.children, settings);
125};
126
127export const tailwindText = (
128 node: TextNode,

Callers 1

convertNodeFunction · 0.85

Calls 6

indentStringFunction · 0.90
tailwindWidgetGeneratorFunction · 0.85
positionMethod · 0.45
sizeMethod · 0.45
blendMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected