1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-23 16:13:21 +00:00

[CL-257] update banner component styles (#10766)

This commit is contained in:
Will Martin
2024-09-04 11:37:50 -04:00
committed by GitHub
parent 5ad5b51ba1
commit 3c4a950636
7 changed files with 14 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
<div
class="tw-flex tw-items-center tw-gap-2 tw-p-2 tw-pl-4 tw-text-contrast tw-border-transparent tw-bg-clip-padding tw-border-solid tw-border-b tw-border-0"
class="tw-flex tw-items-center tw-gap-2 tw-p-2 tw-pl-4 tw-text-main tw-border-transparent tw-bg-clip-padding tw-border-solid tw-border-b tw-border-0"
[ngClass]="bannerClass"
[attr.role]="useAlertRole ? 'status' : null"
[attr.aria-live]="useAlertRole ? 'polite' : null"
@@ -12,7 +12,7 @@
*ngIf="showClose"
type="button"
bitIconButton="bwi-close"
buttonType="contrast"
buttonType="main"
size="default"
(click)="onClose.emit()"
[attr.title]="'close' | i18n"

View File

@@ -28,13 +28,13 @@ export class BannerComponent implements OnInit {
get bannerClass() {
switch (this.bannerType) {
case "danger":
return "tw-bg-danger-600";
return "tw-bg-danger-100 tw-border-b-danger-700";
case "info":
return "tw-bg-info-600";
return "tw-bg-info-100 tw-border-b-info-700";
case "premium":
return "tw-bg-success-600";
return "tw-bg-success-100 tw-border-b-success-700";
case "warning":
return "tw-bg-warning-600";
return "tw-bg-warning-100 tw-border-b-warning-700";
}
}
}

View File

@@ -15,7 +15,8 @@ persist across all pages a user navigates to.
- Use banners sparingly, as they can feel intrusive to the user if they appear unexpectedly. Their
effectiveness may decrease if too many are used.
- Avoid stacking multiple banners.
- Banners support a button link (text button).
- Banners can contain a button or anchor that uses the `bitLink` directive with
`linkType="secondary"`.
<Primary />

View File

@@ -53,7 +53,7 @@ export const Premium: Story = {
template: `
<bit-banner [bannerType]="bannerType" (onClose)="onClose($event)" [showClose]=showClose>
Content Really Long Text Lorem Ipsum Ipsum Ipsum
<button bitLink linkType="contrast">Button</button>
<button bitLink linkType="secondary">Button</button>
</bit-banner>
`,
}),