Skip to content

Commit

Permalink
feat: add flexGrow types from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Jun 22, 2020
1 parent 5ac5099 commit 359a693
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/generation/ClassesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Borders as defaultBorders } from '../classes/Borders';
import { Effects as defaultEffects } from '../classes/Effects';
import { FlexBox as defaultFlexBox } from '../classes/Flexbox';
import isEmpty from 'lodash.isempty';
import { defaultThemeConfig } from './utils/defaultTailwindConfig';

export class ClassesGenerator implements IClassesGenerator {
private readonly configScanner: ConfigScanner;
Expand Down Expand Up @@ -83,7 +84,14 @@ export class ClassesGenerator implements IClassesGenerator {
};

public flexBox = (): string => {
const FlexBox = defaultFlexBox;
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}`)),
};

this.allGeneratedClasses.FlexBox = FlexBox;

Expand Down

0 comments on commit 359a693

Please sign in to comment.