Skip to content
New issue

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

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

Already on GitHub? # to your account

Button - add new properties #466

Closed
daniele-zurico opened this issue Apr 21, 2023 · 1 comment
Closed

Button - add new properties #466

daniele-zurico opened this issue Apr 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@daniele-zurico
Copy link
Contributor

daniele-zurico commented Apr 21, 2023

For the button component, we want to provide two more properties to support in the future the design system tokens:

  • className? (optional)
  • variant?: 'primary' | 'secondary' | 'tertiary';

The className property needs to provide the ability:

  1. for the developer to provide his own class
  2. needs to have the className dcx-button hardcoded (please use the utility classNames)

If the variant property is specified needs to provide the ability to choose between primary|secondary|tertiary so the className will become `dcx-button--[variant]

some examples:

  • the developer doesn't specify any className so the output will be:
<button class="dcx-button">
  • the developer specifies his own class but not a variant:
<button class="dcx-button daniele">
  • the developer specifies a variant primary
<button class="dcx-button dcx-button--primary">
  • the developer specifies a variant secondary
<button class="dcx-button dcx-button--secondary">
  • the developer specifies a variant primary and his own className
<button class="dcx-button daniele dcx-button--primary">

Please follow these steps to create your branch:

git checkout release/0.8
git pull
git checkout -b 'feature/button-new-props'
@daniele-zurico
Copy link
Contributor Author

closed by #490

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants