Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/purple-lands-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@digdir/designsystemet-css": patch
---

**link**: Style background, border, and padding regardless of default browser styles ([#4231](https://github.com/digdir/designsystemet/issues/4231))
11 changes: 11 additions & 0 deletions packages/css/src/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
text-underline-offset: 0.27em; /* 5px ish */
border-radius: var(--dsc-link-border-radius);

/* Revert <button> styling */
&:is(button) {
background: none;
border: none;
cursor: pointer;
font: inherit;
margin: 0;
padding: 0;
text-align: inherit;
}

& :is(img, svg) {
vertical-align: middle; /* Align img or svg icon with text */
}
Expand Down
8 changes: 8 additions & 0 deletions packages/react/src/components/link/link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,11 @@ export const Neutral: Story = {
'data-color': 'neutral',
},
};

export const AsButton: Story = {
args: {
children: <button type='button'>Gå til designsystemet</button>,
href: designsystemetLink,
asChild: true,
},
};
Loading