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

Overwrite components to have color props #145

Open
jennur opened this issue Jul 6, 2022 · 0 comments
Open

Overwrite components to have color props #145

jennur opened this issue Jul 6, 2022 · 0 comments

Comments

@jennur
Copy link
Member

jennur commented Jul 6, 2022

As discussed with @kpsherva

Is your feature request related to a problem? Please describe.

Some SUI components (e.g. <Label />, <Icon />, <Button />) have a color prop that is/was frequently used by us, but it only takes hardcoded colors ("red", "blue", "green"...). Therefore, we have introduced general color classes ("positive", "negative", "neutral", "warning", "expired"), but these are currently added to className and thus not following the SUI React structure (as for buttons and the positive/negative prop, e.g. <Button positive />.

In SUI only positive and negative exists, and only for the <Button /> component.

Describe the solution you'd like

Overwrite components that use color-classes (any component that has the prop color), so that our general color classes can be added as props instead of adding the class to className or hardcoding the colors in the color-prop.

Colors should be possible to add like the following:

<SUIElement colorName /> where <SUIElement/> is any element that can have a specified color, and colorName is any of the following: positive, negative, neutral, warning, expired.

Examples

  • <Label positive />
  • <Icon negative />
  • <Button warning />
@jennur jennur added the enhancement New feature or request label Jul 6, 2022
@jennur jennur added this to To do in InvenioRDM v9.1 Release sprint via automation Jul 6, 2022
@jennur jennur moved this from To do to Triage in InvenioRDM v9.1 Release sprint Jul 6, 2022
@kpsherva kpsherva added this to Triage in Accessibility / UI / UX via automation Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant