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

[Enhancement]: Add support for specifying a custom class name on CardNode #1221

Closed
AlanGreene opened this issue Nov 20, 2021 · 2 comments · Fixed by #1222
Closed

[Enhancement]: Add support for specifying a custom class name on CardNode #1221

AlanGreene opened this issue Nov 20, 2021 · 2 comments · Fixed by #1222

Comments

@AlanGreene
Copy link
Contributor

Contact Details

No response

Summary

Add support for specifying a custom class name on the CardNode react component which can then be used to control the colour of the border or other styles as needed.

Justification

The CardNode react component has a color prop which can be used to specify the colour of the border applied on the outer node. However, this requires the consuming code to be aware of the active theme, handle dark mode, etc. to select an appropriate colour in some cases.

For component libraries this can be problematic as now both the components and their consumers need to be aware of theme rather than relying on this being handled entirely in (S)CSS.

Desired UX and success metrics

Consumers of the CardNode component can add a custom class to the outer node and use this to style the card and its children.

"Must have" functionality

n/a

Specific timeline issues / requests

n/a

Available extra resources

I can implement this if it's an acceptable change.

AlanGreene added a commit to AlanGreene/carbon-charts that referenced this issue Nov 20, 2021
…outer node

The CardNode component has a `color` prop which can be used to specify the
colour of the border applied on the outer node. However, this requires the
code to be aware of the active theme, handle dark mode, etc. to select an
appropriate colour in some cases.

For component libraries this can be problematic as now both the components
and their consumers need to be aware of theme rather than relying on this
being handled entirely in (S)CSS.

Add support for applying a custom class to the CardNode component which will
be applied to the outer node and can be used to apply styles to the card and
its children, including specifying the border colour for the card.

resolves carbon-design-system#1221
@theiliad
Copy link
Member

I can implement this if it's an acceptable change.

Sure! Feel free to make a PR 🙂

@AlanGreene
Copy link
Contributor Author

Thanks for the quick response. PR here #1222

There were a number of formatting changes in unrelated files (including changelogs for other packages) after running yarn run commit that I didn't include. Let me know if I should and I'll update the PR.

AlanGreene added a commit to AlanGreene/carbon-charts that referenced this issue Nov 30, 2021
…outer node

The CardNode component has a `color` prop which can be used to specify the
colour of the border applied on the outer node. However, this requires the
code to be aware of the active theme, handle dark mode, etc. to select an
appropriate colour in some cases.

For component libraries this can be problematic as now both the components
and their consumers need to be aware of theme rather than relying on this
being handled entirely in (S)CSS.

Add support for applying a custom class to the CardNode component which will
be applied to the outer node and can be used to apply styles to the card and
its children, including specifying the border colour for the card.

resolves carbon-design-system#1221

Add similar `className` prop to all diagram components for consistency.
AlanGreene added a commit to AlanGreene/carbon-charts that referenced this issue Dec 1, 2021
…outer node

The CardNode component has a `color` prop which can be used to specify the
colour of the border applied on the outer node. However, this requires the
code to be aware of the active theme, handle dark mode, etc. to select an
appropriate colour in some cases.

For component libraries this can be problematic as now both the components
and their consumers need to be aware of theme rather than relying on this
being handled entirely in (S)CSS.

Add support for applying a custom class to the CardNode component which will
be applied to the outer node and can be used to apply styles to the card and
its children, including specifying the border colour for the card.

resolves carbon-design-system#1221

Add similar `className` prop to all diagram components for consistency.
theiliad pushed a commit that referenced this issue Dec 1, 2021
…outer node (#1222)

The CardNode component has a `color` prop which can be used to specify the
colour of the border applied on the outer node. However, this requires the
code to be aware of the active theme, handle dark mode, etc. to select an
appropriate colour in some cases.

For component libraries this can be problematic as now both the components
and their consumers need to be aware of theme rather than relying on this
being handled entirely in (S)CSS.

Add support for applying a custom class to the CardNode component which will
be applied to the outer node and can be used to apply styles to the card and
its children, including specifying the border colour for the card.

resolves #1221

Add similar `className` prop to all diagram components for consistency.
@theiliad theiliad added this to Done in Q4- 2021 Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2 participants