Skip to content

Commit

Permalink
fix: duplicate runtime for notch, android, and ios (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeVoresyah authored Oct 26, 2022
1 parent cd2c656 commit 394037c
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions src/core/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,47 +34,49 @@ export const applyHelper =
throw new Error("Invalid styling syntax.");
}

// check if width & size using responsive method or not
instanceStyle.responsiveSize(syntax);
// Check for android platform only
instanceStyle.android(syntax);

// auto generate percentage size
instanceStyle.percentSize(syntax);
// Check for ios platform only
instanceStyle.ios(syntax);

// auto generate fixed width size
instanceStyle.fixedWidthSize(syntax);
// Check if there's notch or not.
instanceStyle.notch(syntax);

// auto generate fixed width size
instanceStyle.fixedHeightSize(syntax);
if (!syntax.includes("android:") && !syntax.includes("ios:") && !syntax.includes("notch:")) {
// check if width & size using responsive method or not
instanceStyle.responsiveSize(syntax);

// auto generate transform position
instanceStyle.transformTranslate(syntax);
// auto generate percentage size
instanceStyle.percentSize(syntax);

// auto generate transform scale
instanceStyle.transformScale(syntax);
// auto generate fixed width size
instanceStyle.fixedWidthSize(syntax);

// auto generate transform skew
instanceStyle.transformSkew(syntax);
// auto generate fixed width size
instanceStyle.fixedHeightSize(syntax);

// auto generate transform rotate
instanceStyle.transformRotate(syntax);
// auto generate transform position
instanceStyle.transformTranslate(syntax);

// Check if there's coloring opacity
instanceStyle.colorOpacity(syntax);
// auto generate transform scale
instanceStyle.transformScale(syntax);

// Check if there's any dark theme
instanceStyle.darkTheme(syntax, themeContext?.mode ?? "system");
// auto generate transform skew
instanceStyle.transformSkew(syntax);

// Generate from pre-defined styles
instanceStyle.predefinedStyles(syntax);
// auto generate transform rotate
instanceStyle.transformRotate(syntax);

// Check for android platform only
instanceStyle.android(syntax);
// Check if there's coloring opacity
instanceStyle.colorOpacity(syntax);

// Check for ios platform only
instanceStyle.ios(syntax);
// Check if there's any dark theme
instanceStyle.darkTheme(syntax, themeContext?.mode ?? "system");

// Check if there's notch or not.
instanceStyle.notch(syntax);
// Generate from pre-defined styles
instanceStyle.predefinedStyles(syntax);
}
});

outputStyles.push(instanceStyle.getOutputStyle());
Expand Down

0 comments on commit 394037c

Please sign in to comment.