fix(css): link: Style background, border, and padding regardless of default browser styles #4231#4302
Merged
Barsnes merged 1 commit intodigdir:mainfrom Dec 10, 2025
Conversation
🦋 Changeset detectedLatest commit: 9b1fc02 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Barsnes
reviewed
Dec 10, 2025
|
|
||
| export const AsButton: Story = { | ||
| args: { | ||
| children: <button>Gå til designsystemet</button>, |
Member
There was a problem hiding this comment.
Suggested change
| children: <button>Gå til designsystemet</button>, | |
| children: <button type='button'>Gå til designsystemet</button>, |
Barsnes
reviewed
Dec 10, 2025
packages/css/src/link.css
Outdated
| /* Revert <button> styling */ | ||
| background: none; | ||
| border: none; | ||
| padding: 0; |
Member
There was a problem hiding this comment.
<button> needs font: inherit, and I did also not get a pointer cursors when testing 🤔
Suggested change
| padding: 0; | |
| &:is(button) { | |
| background: none; | |
| border: none; | |
| cursor: pointer; | |
| font: inherit; | |
| margin: 0; | |
| padding: 0; | |
| text-align: inherit; | |
| } |
Member
|
And thanks for the PR! Looks great, just a few minor tweaks |
…efault browser styles digdir#4231
b3d65e3 to
9b1fc02
Compare
Contributor
Author
|
Thanks for the review! Really appreciate it |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4231 by setting background, border, and padding to a "default" value, which matches the
<a>tag and more importantly overwrites the default<button>stylesAlso added a story for it. Maybe not needed idk
Checks
pnpm changesetif relevant)