Skip to content

Commit

Permalink
Inline Alert: <Link>-components used within avoids re-colororing (#…
Browse files Browse the repository at this point in the history
…3461)

* 💄 Avoid coloring links whe used in Inline Alert

* 📝 Alert changeset

* Update .changeset/eleven-gorillas-scream.md

Co-authored-by: Halvor Haugan <[email protected]>

* 📝 Added link-demo to inline-story

---------

Co-authored-by: Halvor Haugan <[email protected]>
  • Loading branch information
KenAJoh and HalvorHaugan authored Dec 17, 2024
1 parent b6db2c4 commit 06193ae
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-gorillas-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Alert: Link-components used within Alert variant='inline' now preserves default coloring
2 changes: 1 addition & 1 deletion @navikt/core/css/darkside/link.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
}

.navds-alert,
.navds-alert:not(.navds-alert--inline),
.navds-confirmation-panel {
& .navds-link {
color: var(--ax-text-default);
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
text-decoration: underline;
}

.navds-alert .navds-link,
.navds-alert:not(.navds-alert--inline) .navds-link,
.navds-confirmation-panel .navds-link {
color: var(--a-text-default);
}
Expand Down
8 changes: 4 additions & 4 deletions @navikt/core/react/src/alert/alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,17 @@ export const Inline: StoryFn = () => {
<Alert variant="info" inline>
Id elit esse enim reprehenderit enim nisi veniam nostrud. Id elit esse
enim reprehenderit enim nisi veniam nostrud. Id elit esse enim
reprehenderit enim nisi veniam nostrud. Id elit esse enim reprehenderit
enim nisi veniam nostrud.
reprehenderit enim nisi veniam nostrud.{" "}
<Link href="#">Id elit esse enim reprehenderit</Link>
</Alert>
<Alert variant="info" size="small" inline>
Id elit esse enim reprehenderit enim nisi veniam nostrud.
</Alert>
<Alert variant="info" size="small" inline>
Id elit esse enim reprehenderit enim nisi veniam nostrud. Id elit esse
enim reprehenderit enim nisi veniam nostrud. Id elit esse enim
reprehenderit enim nisi veniam nostrud. Id elit esse enim reprehenderit
enim nisi veniam nostrud.
reprehenderit enim nisi veniam nostrud.{" "}
<Link href="#">Id elit esse enim reprehenderit</Link>
</Alert>
</VStack>
);
Expand Down

0 comments on commit 06193ae

Please sign in to comment.