Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for default padding in Card's configuration #425

Closed
marcopiii opened this issue Nov 4, 2022 · 4 comments
Closed

Add support for default padding in Card's configuration #425

marcopiii opened this issue Nov 4, 2022 · 4 comments
Assignees

Comments

@marcopiii
Copy link
Member

The Card component's configuration is

declare type CardConfig = {
    defaultRadius: Exclude<BentoSprinkles["borderRadius"], "circled">;
};

It makes sense to also support a defaultPadding.

Currently, it's implicitly 0.

@marcopiii
Copy link
Member Author

This one is tricky: should the defaultPadding refer to

  • padding
  • { paddingX, paddingY }
  • { paddingTop, paddingBottom, paddingLeft, paddingRight }
  • a union of the previous ones?

@gabro @veej

@marcopiii marcopiii self-assigned this Nov 4, 2022
@veej
Copy link
Member

veej commented Nov 11, 2022

@agnese could you please add your opinion here?

@gabro
Copy link
Member

gabro commented Nov 11, 2022

I think it would be ok to have something like:

type PaddingKey =
  | "paddingX"
  | "paddingY"
  | "paddingLeft"
  | "paddingRight"
  | "paddingTop"
  | "paddingBottom";

type DefaultPadding = number | { [k in PaddingKey]?: 0 | BentoSprinkles["padding"] }

which is basically what Card uses (with the shortcut number for padding)

@federico-ercoles
Copy link
Contributor

Added in #682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants