Skip to content

Commit

Permalink
feat(PD-393): autolayout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattchewone committed Feb 4, 2025
1 parent 9854b59 commit ce48adc
Show file tree
Hide file tree
Showing 16 changed files with 6,633 additions and 306 deletions.
9 changes: 4 additions & 5 deletions src/processors/layout.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export const layoutProcessors: StyleProcessor[] = [
process: async (variables, node?: SceneNode): Promise<ProcessedValue | null> => {
const gapVariable = variables.find(v => v.property === 'gap');
if (gapVariable) {

return {
value: gapVariable.value,
rawValue: gapVariable.rawValue,
Expand All @@ -101,7 +100,7 @@ export const layoutProcessors: StyleProcessor[] = [
},
{
property: "min-width",
bindingKey: undefined,
bindingKey: "minWidth",
process: async (variables: VariableToken[], node?: SceneNode): Promise<ProcessedValue | null> => {
const minWidthVariable = variables.find(v => v.property === 'minWidth');
if (minWidthVariable) {
Expand All @@ -124,7 +123,7 @@ export const layoutProcessors: StyleProcessor[] = [
},
{
property: "max-width",
bindingKey: undefined,
bindingKey: "maxWidth",
process: async (variables: VariableToken[], node?: SceneNode): Promise<ProcessedValue | null> => {
const maxWidthVariable = variables.find(v => v.property === 'maxWidth');
if (maxWidthVariable) {
Expand All @@ -147,7 +146,7 @@ export const layoutProcessors: StyleProcessor[] = [
},
{
property: "min-height",
bindingKey: undefined,
bindingKey: "minHeight",
process: async (variables: VariableToken[], node?: SceneNode): Promise<ProcessedValue | null> => {
const minHeightVariable = variables.find(v => v.property === 'minHeight');
if (minHeightVariable) {
Expand All @@ -170,7 +169,7 @@ export const layoutProcessors: StyleProcessor[] = [
},
{
property: "max-height",
bindingKey: undefined,
bindingKey: "maxHeight",
process: async (variables: VariableToken[], node?: SceneNode): Promise<ProcessedValue | null> => {
const maxHeightVariable = variables.find(v => v.property === 'maxHeight');
if (maxHeightVariable) {
Expand Down
1 change: 0 additions & 1 deletion src/services/collection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export async function collectTokens(): Promise<TokenCollection> {
}
}
}

await processNode(figma.currentPage);
return collection;
}
Loading

0 comments on commit ce48adc

Please sign in to comment.