Skip to content

Commit

Permalink
feat: add info color and implement it on alert and notification (#761)
Browse files Browse the repository at this point in the history
Implement new color: Info.

Uptadate alert and notification components info variant color with the
new color and update radius to match design document.

Also update tooltip component default background color to info. This
change can be overridden by `--bl-popover-background-color` variable.

Closes #685
  • Loading branch information
ogunb authored Jan 11, 2024
1 parent 1b5a10e commit a99ff41
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/design-system/colors.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ Baklava uses a list of defined color with some default values.
subtitle="Warning Color"
colors={{ '': 'var(--bl-color-warning)', '--highlight': 'var(--bl-color-warning-highlight)', '--contrast': 'var(--bl-color-warning-contrast)' }}
/>
<ColorItem
title="--bl-color-info"
subtitle="Info Color"
colors={{ '': 'var(--bl-color-info)', '--highlight': 'var(--bl-color-info-highlight)', '--contrast': 'var(--bl-color-info-contrast)' }}
/>
<ColorItem
title="--bl-color-neutral"
subtitle="Neutral Colors"
Expand Down
6 changes: 3 additions & 3 deletions src/components/alert/bl-alert.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

.alert {
--padding: var(--bl-size-m);
--main-color: var(--bl-color-primary);
--main-bg-color: var(--bl-color-primary-contrast);
--main-color: var(--bl-color-info);
--main-bg-color: var(--bl-color-info-contrast);

position: relative;
display: flex;
Expand All @@ -14,7 +14,7 @@
background-color: var(--main-bg-color);
color: var(--bl-color-neutral-darker);
box-shadow: inset 0 0 0 1px var(--main-color);
border-radius: var(--bl-border-radius-s);
border-radius: var(--bl-border-radius-l);
padding: calc(var(--padding) / 2) var(--padding);
padding-right: calc(var(--padding) / 2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/alert/bl-alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default class BlAlert extends LitElement {

const variant = slotElement.name === "action-secondary" ? "secondary" : "primary";
const buttonTypes: Record<AlertVariant, string> = {
info: "default",
info: "neutral",
warning: "neutral",
success: "success",
danger: "danger",
Expand Down
2 changes: 1 addition & 1 deletion src/components/notification/card/bl-notification-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
}

.notification[variant="info"] .duration > .remaining {
background-color: var(--bl-color-primary);
background-color: var(--bl-color-info);
}
2 changes: 1 addition & 1 deletion src/components/tooltip/bl-tooltip.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}

bl-popover {
--bl-popover-background-color: var(--bl-color-neutral-darker);
--bl-popover-background-color: var(--bl-color-info);
--bl-popover-arrow-display: block;
--bl-popover-border-size: 0px;
--bl-popover-max-width: 424px;
Expand Down
5 changes: 5 additions & 0 deletions src/themes/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
--bl-color-warning-highlight: #ff9800;
--bl-color-warning-contrast: #fff8e6;

/* Info Color */
--bl-color-info: #5794ff;
--bl-color-info-highlight: #457eff;
--bl-color-info-contrast: #eef4ff;

/* Neutral Color */
--bl-color-neutral-none: #000;
--bl-color-neutral-darkest: #0f131a;
Expand Down

0 comments on commit a99ff41

Please sign in to comment.