Skip to content

Commit

Permalink
Merge pull request #129 from fictoan/badge-fix
Browse files Browse the repository at this point in the history
v1.8.3
  • Loading branch information
sujan-s authored Nov 24, 2024
2 parents 97211fb + bf9fd1b commit 6b855aa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## 1.8.3
- Add default styles for `Badge`

## 1.8.1
#### ⚠️ BREAKING CHANGES ⚠️
- Remove `SidebarItemIcon` and `SidebarItemText` components to simplify markup
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fictoan-react",
"version": "1.8.1",
"version": "1.8.3",
"private": false,
"description": "",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const Badge = React.forwardRef(
<Text
className="dismiss-button"
onClick={handleDelete}
onKeyPress={handleKeyPress}
onKeyDown={handleKeyPress}
role="button"
tabIndex={0}
aria-label={`Remove ${label || children}`}
Expand Down
6 changes: 5 additions & 1 deletion src/components/Badge/badge.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
height : fit-content;
display : flex;
align-items : center;
background-color : var(--badge-bg);
color : var(--badge-text);
border-color : var(--badge-border);
border-style : solid;

/* To make sure a badge’s children don’t style themselves like a d-bag*/
> * { all : unset; }
Expand All @@ -36,7 +40,7 @@
}

&:active {
transform : scale(0.9);
transform : scale(0.9);
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/styles/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
/* BADGE //////////////////////////////////////////////////////////////////// */
:root {
--badge-font : var(--paragraph-font);
--badge-bg : var(--blue-light60);
--badge-text : var(--blue-dark20);

--badge-border : var(--blue);
--badge-border-radius : var(--global-border-radius);
--badge-border-width : var(--global-border-width);

--badge-bg-default : var(--blue-light60);
--badge-text-default : var(--blue-dark20);
}

/* BODY ///////////////////////////////////////////////////////////////////// */
Expand Down

0 comments on commit 6b855aa

Please sign in to comment.