Skip to content

Commit

Permalink
feat: add order classes types generation from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Jun 22, 2020
1 parent d31bb56 commit fd24095
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
17 changes: 7 additions & 10 deletions src/generation/ClassesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,13 @@ export class ClassesGenerator implements IClassesGenerator {
public flexBox = (): string => {
const FlexBox = {
...defaultFlexBox,
flexGrow: Object.keys(
isEmpty(this.configScanner.themeConfig.flexGrow)
? defaultThemeConfig.flexGrow
: (this.configScanner.themeConfig.flexGrow as { [key: string]: string }),
).map(value => 'flex-grow' + (value === 'default' ? '' : `-${value}`)),
flexShrink: Object.keys(
isEmpty(this.configScanner.themeConfig.flexShrink)
? defaultThemeConfig.flexShrink
: (this.configScanner.themeConfig.flexShrink as { [key: string]: string }),
).map(value => 'flex-shrink' + (value === 'default' ? '' : `-${value}`)),
flexGrow: Object.keys(this.configScanner.themeConfig.flexGrow).map(
value => 'flex-grow' + (value === 'default' ? '' : `-${value}`),
),
flexShrink: Object.keys(this.configScanner.themeConfig.flexShrink).map(
value => 'flex-shrink' + (value === 'default' ? '' : `-${value}`),
),
order: Object.keys(this.configScanner.themeConfig.order).map(value => `order-${value}`),
};

this.allGeneratedClasses.FlexBox = FlexBox;
Expand Down
6 changes: 3 additions & 3 deletions src/generation/_definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ interface IThemeProps {
flex?: {
[key: string]: string;
};
flexGrow?: {
flexGrow: {
[key: string]: string;
};
flexShrink?: {
flexShrink: {
[key: string]: string;
};
fontFamily?: {
Expand Down Expand Up @@ -122,7 +122,7 @@ interface IThemeProps {
opacity?: {
[key: string]: string;
};
order?: {
order: {
[key: string]: string;
};
padding: any;
Expand Down

0 comments on commit fd24095

Please sign in to comment.