Skip to content

anchor: add visited configurable#92

Open
devadula-nandan wants to merge 9 commits into
carbon-design-system:mainfrom
devadula-nandan:anchor-visited-styles
Open

anchor: add visited configurable#92
devadula-nandan wants to merge 9 commits into
carbon-design-system:mainfrom
devadula-nandan:anchor-visited-styles

Conversation

@devadula-nandan

@devadula-nandan devadula-nandan commented Jun 21, 2026

Copy link
Copy Markdown

Closes N/A

Observed while building WYSIWYG editor (also while reviewing carbon-design-system/carbon#21887) when i noticed visited styles are missing from anchor tags.
Add configurable :visited styles to anchor element

I have default it to false. waiting for a review. to decide if we can default it to true. and configurable to be false.
so that it matches the native anchor behavior by default.

Changelog

New

  • new anchor config style for :visited state

Testing / Reviewing

new demo path /?element=anchor&demo=visited can be found and verified

Screen.Recording.2026-06-22.at.11.03.06.PM.mov

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation (notes, example, sass annotations)
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

@janhassel janhassel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for bringing this up, @devadula-nandan!

I agree actually that the default should be true instead of false to more closely align with web standards. In addition to that I only have two minor comments.

Comment thread docs/elements/anchor/index.ts Outdated
Comment thread scss/elements/anchor/index.scss Outdated

@janhassel janhassel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great overall! I'm just noticing some browser inconsistencies.

In Safari (tested with 26.5) the icon doesn't receive the correct color:

Image

In Firefox (tested with 152), there are artifacts when hovering over a visited link

Image

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