Skip to content

Commit

Permalink
add colors and more styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Aug 9, 2024
1 parent d069ada commit d93b8fe
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/css/badge.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@
transform: translateX(50%) translateY(-50%);
}

.ds-bade--accent {
--dsc-badge-background: var(--ds-color-accent-base-default);
--dsc-badge-color: var(--ds-color-accent-contrast-default);
}

.ds-badge--info {
--dsc-badge-background: var(--ds-color-info-base-default);
--dsc-badge-color: var(--ds-color-info-contrast-default);
}

.ds-badge--success {
--dsc-badge-background: var(--ds-color-success-base-default);
--dsc-badge-color: var(--ds-color-success-contrast-default);
}

.ds-badge--warning {
--dsc-badge-background: var(--ds-color-warning-base-default);
--dsc-badge-color: var(--ds-color-warning-contrast-default);
}

.ds-badge--danger {
--dsc-badge-background: var(--ds-color-danger-base-default);
--dsc-badge-color: var(--ds-color-danger-contrast-default);
}

.ds-badge--neutral {
--dsc-badge-background: var(--ds-color-neutral-base-default);
--dsc-badge-color: var(--ds-color-neutral-contrast-default);
}

.ds-badge--sm {
--dsc-badge-height: var(--ds-sizing-3);
--dsc-badge-width: var(--ds-sizing-3);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/Badge/Badge.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Preview.args = {
/* children: <CogIcon fontSize='2rem' />, */
count: 10,
maxCount: 9,
color: 'accent',
};
1 change: 1 addition & 0 deletions packages/react/src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
className={cl(
'ds-badge',
`ds-badge--${size}`,
`ds-badge--${color}`,
count && 'ds-badge--count',
children && 'ds-badge--float',
)}
Expand Down

0 comments on commit d93b8fe

Please sign in to comment.