Skip to content

Commit

Permalink
fix: add result of property modification to returned classes with colors
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Jul 3, 2020
1 parent d9663d6 commit fe458c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/generation/ClassesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,15 @@ export class ClassesGenerator implements IGenerator {
return propertyNames.flatMap((propertyValue, i) => {
const variant = propertyVariants[i];

property.replace('Color', '').replace('background', 'bg');
const propertyResult = property.replace('Color', '').replace('background', 'bg');

if (typeof variant === 'object' && variant !== null) {
return Object.keys(variant).map(
v => `${property}-${propertyValue}${v === 'default' ? '' : `-${v}`}`,
v => `${propertyResult}-${propertyValue}${v === 'default' ? '' : `-${v}`}`,
);
} else {
return `${propertyResult}-${propertyValue}`;
}
return `${property}-${propertyValue}`;
});
};

Expand Down

0 comments on commit fe458c9

Please sign in to comment.