Skip to content

Commit

Permalink
feat: generate border width types from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Jun 22, 2020
1 parent c0ae9e4 commit b733566
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/generation/ClassesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export class ClassesGenerator implements IClassesGenerator {
side => `rounded${side === '' ? '' : '-' + side}` + (radius === 'default' ? '' : `-${radius}`),
);
}),
borderWidth: Object.keys(this.configScanner.themeConfig.borderWidth).flatMap(width => {
const sides = ['', 't', 'r', 'b', 'l'];
return sides.map(side => `border${side === '' ? '' : '-' + side}` + (width === 'default' ? '' : `-${width}`));
}),
};

this.allGeneratedClasses.Borders = Borders;
Expand Down
2 changes: 1 addition & 1 deletion src/generation/_definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface IThemeProps {
borderRadius: {
[key: string]: string;
};
borderWidth?: {
borderWidth: {
[key: string]: string;
};
boxShadow?: {
Expand Down

0 comments on commit b733566

Please sign in to comment.