Skip to content

fix(buttons): match Figma padding + icon sizing across variants#300

Open
Infi-Knight wants to merge 1 commit into
stagingfrom
ravi/fix-button-padding
Open

fix(buttons): match Figma padding + icon sizing across variants#300
Infi-Knight wants to merge 1 commit into
stagingfrom
ravi/fix-button-padding

Conversation

@Infi-Knight
Copy link
Copy Markdown
Contributor

@Infi-Knight Infi-Knight commented May 18, 2026

Aligns the shared button component with Figma after a design audit.

  • buttonVariants.ts: symmetric p-lg / p-md instead of py-* overrides; iconOnly no longer forces px-0; replaced iconSide with iconPosition using logical ps-* / pe-* (text side bumps one size for optical balance); FAB inherits base padding.
  • Button.astro / LinkButton.astro: iconPosition auto-derived from Astro.slots.has('icon-left' | 'icon-right'); old iconSide prop removed.
  • Icon.astro: numeric size prop (default 20) maps to SVG width / height; shrink-0 to prevent flex-induced squashing on FABs.
  • PillarCard.astro: FAB passes iconOnly and size={24}.

Figma: primary · secondary · FAB.

Manual test

Open /preview/ui-components, spot-check that buttons have p-lg / p-md symmetric padding by default and pe-xl / ps-xl (lg) or pe-lg / ps-lg (sm) on text+icon variants. FAB renders as a 48×48 circle.

Checks

  • pnpm run format
  • pnpm run lint

@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for interledger-org-v5 ready!

Name Link
🔨 Latest commit 962b0eb
🔍 Latest deploy log https://app.netlify.com/projects/interledger-org-v5/deploys/6a0ef6b60d308d00082b5de8
😎 Deploy Preview https://deploy-preview-300--interledger-org-v5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Infi-Knight Infi-Knight force-pushed the ravi/fix-button-padding branch from d1abdb2 to 39c1c8b Compare May 18, 2026 09:11
@Infi-Knight Infi-Knight requested a review from Anca2022 May 18, 2026 09:13
@Infi-Knight Infi-Knight self-assigned this May 18, 2026
@Infi-Knight Infi-Knight marked this pull request as ready for review May 19, 2026 06:27
@Infi-Knight
Copy link
Copy Markdown
Contributor Author

Uploading Screenshot 2026-05-19 at 3.02.47 PM.png…
lighthouse

Audit of the primary/secondary/FAB button designs in Figma surfaced
three padding bugs and one icon-size bug in the shared button
component:

1. Lg buttons used px-xl (24px) horizontally regardless of content,
   producing 16/24 instead of Figma's 16/16 for text-only buttons.
2. iconOnly buttons forced px-0 + aspect-square, producing a tight
   box rather than Figma's symmetric p-lg/p-md.
3. Icon+text buttons rendered symmetric padding; Figma calls for
   asymmetric horizontal padding (text side +1 t-shirt size) to
   visually balance the icon.
4. FAB icon rendered at the Icon component's 20px default. Per the
   PillarCard FAB reference (and Framer prod), it should be 16px.

Changes:

- buttonVariants.ts: base size variants now use p-lg/p-md (square);
  iconOnly drops px-0; new iconPosition axis with compoundVariants
  for asymmetric text+icon padding; removed the FAB-specific
  py-md/px-md override so FAB inherits Figma-correct 16px padding.
- Button.astro / LinkButton.astro: auto-derive iconPosition from
  filled slots via Astro.slots.has(), so callers don't need to know
  about the new axis.
- Icon.astro: expose a numeric size prop that maps to the SVG's
  width/height attributes (more reliable than class-based sizing for
  SVG dimensions in this Tailwind v4 setup).
- PillarCard.astro + preview: explicit size={16} on the FAB icon.
- preview: updated the "Symmetric vs asymmetric padding" section to
  reflect the new base values (lg→xl, md→lg text-side bump).

Live verification of rendered measurements (preview/ui-components):

  primary lg text     78×48     pad 16/16/16/16   matches Figma
  primary lg icon-only 48×48    pad 16/16/16/16   matches Figma
  primary sm text     71×44     pad 12/12/12/12   matches Figma
  primary sm icon-only 44×44    pad 12/12/12/12   matches Figma
  lg + icon-left      156×48    pad 16/24/16/16   matches Figma
  lg + icon-right     165×48    pad 16/16/16/24   matches Figma
  FAB icon-only       48×48     pad 16/16/16/16   matches Figma
  FAB icon            16×16                       matches Framer

Figma refs:
- Primary button: node 53:573
- Secondary "About us": node 466:58447
- PillarCard FAB: node 466:58457
@Infi-Knight Infi-Knight force-pushed the ravi/fix-button-padding branch from 39c1c8b to 962b0eb Compare May 21, 2026 12:12
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.

1 participant