Skip to content

Commit 68e5fc0

Browse files
authored
adds a warning about ungrouped elements (#162)
1 parent 384e7ed commit 68e5fc0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/backend/src/code.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ import {
55
} from "./common/retrieveUI/retrieveColors";
66
import { generateHTMLPreview, htmlMain } from "./html/htmlMain";
77
import { postConversionComplete, postEmptyMessage } from "./messaging";
8-
import { clearWarnings, warnings } from "./common/commonConversionWarnings";
8+
import {
9+
addWarning,
10+
clearWarnings,
11+
warnings,
12+
} from "./common/commonConversionWarnings";
913
import { PluginSettings } from "types";
1014
import { convertToCode } from "./common/retrieveUI/convertToCode";
1115

@@ -14,6 +18,12 @@ export const run = async (settings: PluginSettings) => {
1418
const { framework } = settings;
1519
const selection = figma.currentPage.selection;
1620

21+
if (selection.length > 1) {
22+
addWarning(
23+
"Ungrouped elements may have incorrect positioning. If this happens, try wrapping the selection in a Frame or Group.",
24+
);
25+
}
26+
1727
const convertedSelection = convertNodesToAltNodes(selection, null);
1828

1929
// ignore when nothing was selected

0 commit comments

Comments
 (0)