Skip to content

Commit

Permalink
[CES-18232] Make banner accessible (#632)
Browse files Browse the repository at this point in the history
* [CES-18232] Make banner accessible

* add type="button"
  • Loading branch information
aurelie-forzani authored Aug 13, 2024
1 parent f00f775 commit fb7ab87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Banner: React.FC<BannerProps> = ({

{/* Close button (optional) */}
{isClosable && onClose && (
<div className="tk-banner__close" onClick={onClose} />
<button type="button" className="tk-banner__close" onClick={onClose} />
)}

</div>
Expand Down
17 changes: 14 additions & 3 deletions packages/styles/src/components/atoms/_banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
&__action {
appearance: none;
background-color: transparent;
outline: none;
border: none;
text-decoration: underline;
}
Expand Down Expand Up @@ -99,22 +98,34 @@
&--small {
padding: toRem(2) toRem(8);

.tk-banner__variant-icon, .tk-banner__close {
.tk-banner__variant-icon {
&:before {
font-size: toRem(12);
top: toRem(4);
}
}

.tk-banner__close {
&:before {
font-size: toRem(12);
}
}
}

&--medium {
padding: toRem(6) toRem(12);

.tk-banner__variant-icon, .tk-banner__close {
.tk-banner__variant-icon {
&:before {
font-size: toRem(16);
top: toRem(2);
}
}

.tk-banner__close {
&:before {
font-size: toRem(16);
}
}
}
}

0 comments on commit fb7ab87

Please sign in to comment.