FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ui): improve symmetry of buttons/links with icons by NeeshSamsi · Pull Request #1542 · npmx-dev/npmx.dev · GitHub

fix(ui): improve symmetry of buttons/links with icons - #1542

Merged
ghostdevv merged 10 commits into
npmx-dev:mainfrom
NeeshSamsi:fix/icon-button-padding
Jun 17, 2026
Merged

fix(ui): improve symmetry of buttons/links with icons#1542
ghostdevv merged 10 commits into
npmx-dev:mainfrom
NeeshSamsi:fix/icon-button-padding

Conversation

Copy link
Copy Markdown
Contributor

Fixes #1255

  1. Adjusts padding on buttons and links when an icon is present to make sure they are optically balanced.
  2. Adjusts padding on icon-only buttons and links to make them square with equal padding on all sides.

When detecting an icon-only button, I am detecting an empty slot. This was not working with the current sr-only spans. I replaced them with aria-label. As far as I know, this shouldn't be a problem but please let me know if that was overstepping on the scope of this change.

This is my first contribution to a major opensource project. Please let me know if I made any mistakes so I can figure it out.

sr-only spans made slots.default truthy, breaking auto-detection. aria-label is an equivalent accessible alternative that lets the slot be empty.
icon-only for mobile only breaks auto-detection. Manually override padding on mobile.

vercel Bot commented Feb 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Preview, Comment Jun 16, 2026 11:54pm
npmx.dev Ready Preview, Comment Jun 16, 2026 11:54pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Jun 16, 2026 11:54pm

Copy link
Copy Markdown
Contributor Author

All the errors scared me for a second but it seems like it's an issue with a package install?

Sybren-crwk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I left a nit-pick comment, feel free to check it out and apply it or not.

Comment thread app/components/Button/Base.vue Outdated
Co-authored-by: Sybren W <sybren.willemot@gmail.com>

coderabbitai Bot commented Feb 27, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

📝 Walkthrough

Walkthrough

This pull request adds icon-only detection to Button and Link base components and updates their medium/small size class bindings accordingly, then converts several package-related link/button instances to use explicit aria-label attributes instead of nested visually-hidden spans.

Changes

Icon-aware styling and accessibility improvements

Layer / File(s) Summary
Icon-aware styling in Button and Link base components
app/components/Button/Base.vue, app/components/Link/Base.vue
Button and Link components now detect icon-only state via a computed iconOnly flag (based on classicon prop and default slot presence). Class bindings for medium and small sizes are updated to apply conditional padding and text-size classes when an icon is present for both disabled span and NuxtLink/button render paths.
Accessibility label migration in Package components
app/components/Package/Dependencies.vue, app/components/Package/Versions.vue, app/components/Package/WeeklyDownloadStats.vue
Vulnerability, deprecated, distribution and “view all versions” link/button elements now provide explicit :aria-label attributes and are rendered as self-closing LinkBase/ButtonBase components; nested sr-only spans containing the same text were removed.

Possibly related PRs

  • npmx-dev/npmx.dev#2752: Modifies app/components/Button/Base.vue class bindings and overlaps at the same component styling logic.

Suggested reviewers

  • alexdln
🚥 Pre-merge checks | ✅ 4 ✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, explaining the padding adjustments for icon buttons and the aria-label changes.
Linked Issues check ✅ Passed The PR successfully addresses issue #1255 by reducing padding around icons in buttons and links to make them optically balanced, as required.
Out of Scope Changes check ✅ Passed The aria-label replacements for sr-only spans are directly related to enabling icon-only button detection, which is a necessary change to meet the PR objectives.
Title check ✅ Passed The title 'fix(ui): improve symmetry of buttons/links with icons' accurately describes the main objective of the PR, which is to adjust padding on buttons and links with icons to make them optically balanced and symmetrical.

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

✨ Finishing Touches 🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

codecov Bot commented Feb 27, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/components/Button/Base.vue 50.00% 0 Missing and 1 partial ⚠️
app/components/Link/Base.vue 50.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actionable comments posted: 1

Caution

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

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

68-87: ⚠️ Potential issue | 🟡 Minor

Disabled LinkBase drops classicon content.

In the disabled branch, only <slot /> is rendered. At Line 68-87, links configured with classicon (especially icon-only usage) can render as an empty control.

🔧 Proposed fix
-  <span
+  <span
     v-if="disabled"
@@
-    ><slot
-  /></span>
+  >
+    <span v-if="classicon" class="size-[1em]" :class="classicon" aria-hidden="true" />
+    <slot />
+  </span>

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 365bd9f and 4d3d6cd.

📒 Files selected for processing (7)
  • app/components/Button/Base.vue
  • app/components/Link/Base.vue
  • app/components/Package/Dependencies.vue
  • app/components/Package/Versions.vue
  • app/components/Package/WeeklyDownloadStats.vue
  • app/pages/index.vue
  • app/pages/package/[[org]]/[name].vue

serhalp requested a review from knowler March 15, 2026 13:54
serhalp added the needs review This PR is waiting for a review from a maintainer label Mar 15, 2026

ghostdevv 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@NeeshSamsi would you be up for updating this PR?

serhalp added stale This has become stale and may be closed soon and removed needs review This PR is waiting for a review from a maintainer labels Apr 10, 2026
github-actions Bot removed the stale This has become stale and may be closed soon label Apr 18, 2026
serhalp added the stale This has become stale and may be closed soon label May 9, 2026
github-actions Bot removed the stale This has become stale and may be closed soon label May 10, 2026
github-actions Bot added the stale This has become stale and may be closed soon label Jun 9, 2026

Copy link
Copy Markdown
Member

I took the liberty to update this PR with new changes from main.
Since I made the changes I would like to have another set of eyes look over it 🙏

github-actions Bot removed the stale This has become stale and may be closed soon label Jun 14, 2026

Copy link
Copy Markdown
Member

The difference seems to be negligible, perhaps it was bigger at the time of the PR opening 🤔 I'll close this for now, but please re-open if anyone disagrees 🙏

cc: @alexdln

With Diff: Without Diff:

ghostdevv closed this Jun 16, 2026

Copy link
Copy Markdown
Member

Actually I do see it xD

ghostdevv reopened this Jun 16, 2026
ghostdevv changed the title fix(ui): improve design of buttons/links with icons fix(ui): improve symmetry of buttons/links with icons Jun 16, 2026
ghostdevv added this pull request to the merge queue Jun 17, 2026
Merged via the queue into npmx-dev:main with commit 7e68437 Jun 17, 2026
24 checks passed

Copy link
Copy Markdown

Thanks for your first contribution, @NeeshSamsi! 💫

We'd love to welcome you to the npmx community. Come and say hi on Discord! And once you've joined, visit npmx.wamellow.com to claim the contributor role.

github-actions Bot mentioned this pull request Jun 17, 2026
BittuBarnwal7479 pushed a commit to BittuBarnwal7479/npmx.dev that referenced this pull request Jun 27, 2026
Co-authored-by: Sybren W <sybren.willemot@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Felix Schneider <99918022+trueberryless@users.noreply.github.com>
Co-authored-by: Willow (GHOST) <git@willow.sh>
ayo-run pushed a commit to ayo-run/npmx.dev that referenced this pull request Aug 5, 2026
Co-authored-by: Sybren W <sybren.willemot@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Felix Schneider <99918022+trueberryless@users.noreply.github.com>
Co-authored-by: Willow (GHOST) <git@willow.sh>
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve design of buttons/links with icons

5 participants


Back | FazBrowse Home | New Git URL