Skip to content

Comments

fix(ui): reduce size of link icon#1566

Merged
danielroe merged 2 commits intonpmx-dev:mainfrom
radosvet93:reduce-size-link-icon
Feb 22, 2026
Merged

fix(ui): reduce size of link icon#1566
danielroe merged 2 commits intonpmx-dev:mainfrom
radosvet93:reduce-size-link-icon

Conversation

@radosvet93
Copy link
Contributor

Fixes: #1563

image

@vercel
Copy link

vercel bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 22, 2026 10:15am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 22, 2026 10:15am
npmx-lunaria Ignored Ignored Feb 22, 2026 10:15am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Adds a single CSS property, font-size: 0.75em, to the a[href^='#']::after rule in the Readme component. The change affects the pseudo-element used for in-page anchor links; no JavaScript, event handling or control flow was modified.

Possibly related PRs

Suggested reviewers

  • danielroe
  • serhalp
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description references the linked issue #1563 and includes an image showing the header with the link icon, clearly relating to the changeset.
Linked Issues check ✅ Passed The pull request successfully implements the core requirement from issue #1563 by reducing the anchor icon size through adding font-size: 0.75em to the CSS rule.
Out of Scope Changes check ✅ Passed The pull request contains only a single CSS property addition directly addressing the linked issue requirement, with no extraneous or unrelated changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/components/Readme.vue (1)

153-162: ⚠️ Potential issue | 🟡 Minor

Move font-size: 0.75em to the base ::after rule to prevent layout shift on hover.

The ::after pseudo-element is already display: inline with ms-1 margin, meaning it occupies inline space in the document flow even when invisible (opacity-0). Since UnoCSS preset-icons sizes icons via width: 1em; height: 1em, applying font-size only in the :hover state causes the reserved space to change size on hover, producing a visible text reflow/layout shift in the heading.

Moving the declaration to the base rule keeps the reserved space constant regardless of hover state.

🐛 Proposed fix
 .readme :deep(a[href^='#']::after) {
   /* I don't know what kind of sorcery this is, but it ensures this icon can't wrap to a new line on its own. */
   content: '__';
-  `@apply` inline i-lucide:link rtl-flip ms-1 opacity-0;
+  `@apply` inline i-lucide:link rtl-flip ms-1 opacity-0;
+  font-size: 0.75em;
 }

 .readme :deep(a[href^='#']:hover::after) {
-  `@apply` opacity-100;
-  font-size: 0.75em;
+  `@apply` opacity-100;
 }

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

.readme :deep(a[href^='#']:hover::after) {
@apply opacity-100;
font-size: 0.75em;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be set not just on hover, but in general on the ::after pseudo element

also a question: do we need to add some padding to increase tap target?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, yes, it should be on the ::after!

Hmm, the whole heading is the tap target, so I don't think it needs padding in that case, unless we want to add functionality to copy to clipboard only when the icon is clicked, then probably it's good to have a bigger tap target specifically for the icon

Copy link
Member

Choose a reason for hiding this comment

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

good point!

@danielroe danielroe added this pull request to the merge queue Feb 22, 2026
Merged via the queue into npmx-dev:main with commit d0d819d Feb 22, 2026
17 checks passed
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.

Reduce anchor icon size in packages

2 participants