Skip to content

Commit

Permalink
fix(ui): add toast border color to make it stand-out
Browse files Browse the repository at this point in the history
  • Loading branch information
18alantom committed Aug 24, 2023
1 parent acf95f3 commit cdc2096
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/Toast.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
rounded-lg
border
"
:class="[config.containerBorder]"
style="pointer-events: auto"
>
<feather-icon
Expand Down
6 changes: 5 additions & 1 deletion src/utils/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export function getBgColorClass(color: string) {
return `bg-${vcolor}-200`;
}

export function getColorClass(color: string, type: 'bg' | 'text', value = 300) {
export function getColorClass(
color: string,
type: 'bg' | 'text' | 'border',
value = 300
) {
return `${type}-${getValidColor(color)}-${value}`;
}

Expand Down
4 changes: 3 additions & 1 deletion src/utils/interactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export function getIconConfig(type: ToastType) {
}[type];

const iconColor = getColorClass(color ?? 'gray', 'text', 400);
const containerBackground = getColorClass(color ?? 'gray', 'bg', 100);
const containerBorder = getColorClass(color ?? 'gray', 'border', 300);

return { iconName, color, iconColor };
return { iconName, color, iconColor, containerBorder, containerBackground };
}

0 comments on commit cdc2096

Please sign in to comment.