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

Move to data-size and data-color and expose on all components #2671

Closed
Tracked by #2508
eirikbacker opened this issue Oct 24, 2024 · 1 comment
Closed
Tracked by #2508

Move to data-size and data-color and expose on all components #2671

eirikbacker opened this issue Oct 24, 2024 · 1 comment

Comments

@eirikbacker
Copy link
Contributor

Description

Since all components (and HTML elements) will support data-size and data-color, we should expose this as props also in React and thus avoiding confusion on when size is available and when it is not.
We can however provide type safety by creating a shared props definition, which all components can extend:

type SharedProps = {
  /** Recommended sizes */
  'data-size'?: 'sm' | 'md' | 'xl';
  'data-color'?: 'red' | 'blue' | (string & {});
}

and

type AccordionProps = SharedProps & { ... }

Additional Information

No response

@eirikbacker
Copy link
Contributor Author

Duplicate of #2655

@eirikbacker eirikbacker marked this as a duplicate of #2655 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant