Skip to content

Commit

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

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 @@ -53,7 +53,7 @@ interface IThemeProps {
[key: string]: string;
};

borderRadius?: {
borderRadius: {
[key: string]: string;
};
borderWidth?: {
Expand Down

0 comments on commit c0ae9e4

Please sign in to comment.