Skip to content

Commit

Permalink
fix(kalert): slotted links default styling [KHCP-14152] (#2528)
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM authored Nov 26, 2024
1 parent a941be5 commit 631a287
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
44 changes: 36 additions & 8 deletions sandbox/pages/SandboxAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,52 @@
<SandboxSectionComponent title="appearance">
<KAlert
appearance="info"
message="This is info alert."
title="Info"
/>
>
This is info alert.
<a
href="https://kongponents.konghq.com/components/alert.html"
target="_blank"
>
Link
</a>
</KAlert>
<KAlert
appearance="success"
message="This is success alert."
title="Success"
/>
>
This is success alert.
<a
href="https://kongponents.konghq.com/components/alert.html"
target="_blank"
>
Link
</a>
</KAlert>
<KAlert
appearance="warning"
message="This is warning alert."
title="Warning"
/>
>
This is warning alert.
<a
href="https://kongponents.konghq.com/components/alert.html"
target="_blank"
>
Link
</a>
</KAlert>
<KAlert
appearance="danger"
message="This is danger alert."
title="Danger"
/>
>
This is danger alert.
<a
href="https://kongponents.konghq.com/components/alert.html"
target="_blank"
>
Link
</a>
</KAlert>
</SandboxSectionComponent>
<SandboxSectionComponent title="showIcon">
<KAlert
Expand Down
16 changes: 14 additions & 2 deletions src/components/KAlert/KAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,26 @@ const getAlertIcon = computed((): AlertIcon => {
@mixin kAlertAppearance(
$backgroundColor: var(--kui-color-background-primary-weakest, $kui-color-background-primary-weakest),
$textColor: var(--kui-color-text-primary, $kui-color-text-primary),
$dismissIconHoverColor: var(--kui-color-text-primary-strong, $kui-color-text-primary-strong)) {
$hoverColor: var(--kui-color-text-primary-strong, $kui-color-text-primary-strong)) {
background-color: $backgroundColor;
color: $textColor;
.alert-dismiss-icon {
&:hover,
&:focus {
color: $dismissIconHoverColor !important;
color: $hoverColor !important;
}
}
.alert-content {
.alert-message {
:slotted(a) {
color: $textColor;
&:hover {
color: $hoverColor;
}
}
}
}
}
Expand Down

0 comments on commit 631a287

Please sign in to comment.