Skip to content

fix(Card): don't require class="ds-link" on links, since that wasn't recommended until recently#4896

Open
unekinn wants to merge 1 commit into
mainfrom
fix/card-link-without-ds-link
Open

fix(Card): don't require class="ds-link" on links, since that wasn't recommended until recently#4896
unekinn wants to merge 1 commit into
mainfrom
fix/card-link-without-ds-link

Conversation

@unekinn
Copy link
Copy Markdown
Contributor

@unekinn unekinn commented May 18, 2026

Summary

Ensures Cards with <a> in a heading element get the correct focus styling, even when class="ds-link" is omitted.

We used to recommend using plain <a> elements without class="ds-link", so there will be plenty of usages like that in the wild.

Before - tab through the links and see that the first link has wrong focus style

After - the focus styles are now the same

Checks

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 62664ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@digdir/designsystemet-css Patch
@digdir/designsystemet-react Patch
@digdir/designsystemet Patch
@digdir/designsystemet-types Patch
@digdir/designsystemet-web Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a957da69-1d6a-472c-b73b-9f87836047cb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/card-link-without-ds-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@unekinn unekinn force-pushed the fix/card-link-without-ds-link branch from 5bd0b58 to 3d97e7d Compare May 18, 2026 11:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Preview deployments for this pull request:

storybook - 18. May 2026 - 14:06

…t recommended until recently

We [used to recommend](https://github.com/digdir/designsystemet/blob/48e991ddae92e30cc3a07dba95cecb46f5aec50b/packages/react/src/components/card/card.stories.tsx#L141-L147)
using plain `<a>` elements without `class="ds-link"`, so there will be
plenty of usages like that in the wild.
@unekinn unekinn changed the title fix(Card): don't require .ds-link class on links in Card, since that wasn't recommended until recently fix(Card): don't require class="ds-link" on links, since that wasn't recommended until recently May 18, 2026
@unekinn unekinn force-pushed the fix/card-link-without-ds-link branch from 3d97e7d to 62664ba Compare May 18, 2026 12:03
"@digdir/designsystemet-css": patch
---

**Card**: when using a link in a Card, ensure plain `<a>` tags without `class="ds-link"` also get the correct focus styling.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Card**: when using a link in a Card, ensure plain `<a>` tags without `class="ds-link"` also get the correct focus styling.
**Card**: fix when using a link in a Card, ensure plain `<a>` tags without `class="ds-link"` also get the correct focus styling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? 🤔 It will be grouped under Patch changes in the changelog already, and your suggested sentence makes less sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants