Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 17, 2025

  • Explore repository structure and understand Card component implementation
  • Run existing tests to confirm baseline (all 14 tests passing)
  • Understand current padding system using size prop and config values
  • Update types to add paddingTop, paddingRight, paddingBottom, paddingLeft props
  • Create utility function to compute padding styles
  • Update Card hook to handle new padding props
  • Update CardBody hook to handle new padding props
  • Update CardHeader hook to handle new padding props
  • Update CardFooter hook to handle new padding props
  • Write comprehensive tests for new padding functionality (11 new tests)
  • Update snapshots (all 25 tests passing)
  • Verify linting passes
  • Update README documentation for Card component
  • Update README documentation for CardBody component
  • Update README documentation for CardHeader component
  • Update README documentation for CardFooter component
  • Build the components package to verify compilation
  • Manual verification with Storybook
Original prompt

This section details on the original issue you should resolve

<issue_title>Card: support more padding options</issue_title>
<issue_description>The size options on the Card component often produce unequal horizontal/padding padding values. For example the large size has 24px vertical padding and 32px horizontal padding.

It can sometimes be desirable to create cards with equal padding, or specify per-side padding values on subcomponents like Card.Header. Let's explore how to offer this functionality in a sustainable way (based on presets/tokens) while considering backwards compatibility.

cc @gigitux </issue_description>

Comments on the Issue (you are @copilot in this section)

@jameskoster One idea I had for this is to introduce some new properties: `paddingTop`, `paddingRight`, `paddingBottom`, `paddingLeft`.

Behavior

  • The existing size prop acts as a shorthand defining top, right, bottom, and left padding values.
  • When any per-side padding property is set, it overrides the corresponding side derived from size.
  • If size is omitted, each padding property applies independently.
  • The padding* props accept values from the spacing scale to maintain design consistency.

Backwards compatibility

  • All existing uses of size remain fully supported.
  • The new properties are additive and non-breaking.

This approach loosely mirrors CSS’s padding shorthand and side-specific properties, offering developers finer control without fragmenting existing patterns or requiring new size presets.</comment_new>

Fixes #72175


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…d components

Co-authored-by: gigitux <4463174+gigitux@users.noreply.github.com>
@gigitux gigitux closed this Oct 17, 2025
Copilot AI requested a review from gigitux October 17, 2025 13:01
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.

Card: support more padding options

2 participants