Skip to content

Commit

Permalink
add some webpack changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattchewone committed Jan 29, 2025
1 parent ada257c commit f69c61c
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 182 deletions.
1 change: 1 addition & 0 deletions src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async function generateStyles(format: 'scss' | 'css'): Promise<TransformerResult

// Listen for messages from the UI
figma.ui.onmessage = async (msg) => {
console.log('msg', msg);
if (msg.type === 'generate-styles') {
const result = await generateStyles(msg.format || 'scss');
generatedScss = result.result; // Store just the generated code
Expand Down
20 changes: 19 additions & 1 deletion src/processors/layout.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const layoutProcessors: StyleProcessor[] = [
}
},
{
property: "align-items",
property: "justify-content",
bindingKey: undefined,
process: async (_, node?: SceneNode): Promise<ProcessedValue | null> => {
if (node && 'layoutMode' in node && node.layoutMode !== "NONE" &&
Expand All @@ -40,6 +40,24 @@ export const layoutProcessors: StyleProcessor[] = [
return null;
}
},
{
property: "align-items",
bindingKey: undefined,
process: async (_, node?: SceneNode): Promise<ProcessedValue | null> => {
if (node && 'layoutMode' in node && node.layoutMode !== "NONE" &&
'counterAxisAlignItems' in node) {
const alignMap = {
MIN: "flex-start",
CENTER: "center",
MAX: "flex-end",
BASELINE: "baseline"
};
const value = alignMap[node.counterAxisAlignItems];
return { value, rawValue: value };
}
return null;
}
},
{
property: "gap",
bindingKey: "itemSpacing",
Expand Down
1 change: 0 additions & 1 deletion src/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<head>
<meta charset="UTF-8" />
<title>Eggstractor</title>
<link rel="stylesheet" href="ui.css">
</head>
<body>
<div class="container">
Expand Down
Loading

0 comments on commit f69c61c

Please sign in to comment.