Skip to content

Commit 5e6f14d

Browse files
authored
Merge pull request #29 from BSoDium/main
Prevent unwanted badge wrap by modifying overflow behaviour
2 parents d01b9cf + 3357812 commit 5e6f14d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/components/badge.component.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export const StyledBadge = styled.span<StyledBadgeProps>(
2323
textTransform: styles?.textTransform || "uppercase",
2424
paddingInline: styles?.paddingInline || "5px",
2525
paddingBlock: styles?.paddingBlock || "2px",
26+
whiteSpace: styles?.whiteSpace || "nowrap",
27+
overflow: styles?.overflow || "hidden",
28+
textOverflow: styles?.textOverflow || "ellipsis",
2629
display: "block",
2730
}),
2831
);

src/typings.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export type BadgeConfig = {
2121
paddingBlock?: Property.PaddingBlock,
2222
paddingInline?: Property.PaddingInline,
2323
textTransform?: Property.TextTransform,
24+
whiteSpace?: Property.WhiteSpace,
25+
overflow?: Property.Overflow,
26+
textOverflow?: Property.TextOverflow,
2427
};
2528
location?: Array<'toolbar' | 'toolbar-extra' | 'sidebar'>;
2629
title?: string;

0 commit comments

Comments
 (0)