Skip to content

Commit

Permalink
feat: Allow Tag to support custom bg and text color via xss (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon authored Dec 14, 2023
1 parent 79a9a43 commit 41dff2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function NoIcon() {
<div css={Css.wPx(200).$}>
<Tag text="Tag text that will truncate as it is too long." />
</div>
<Tag text="Custom color" xss={Css.bgPurple200.$} />
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Icon, IconKey } from "src/components";
import { Css, Margin, Only, Xss } from "src/Css";
import { useTestIds } from "src/utils";

type TagXss = Margin;
type TagXss = Margin | "backgroundColor" | "color";
export type TagType = "info" | "caution" | "warning" | "success" | "neutral";
interface TagProps<X> {
text: string;
Expand Down

0 comments on commit 41dff2a

Please sign in to comment.