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

[bug] rh-card public css property to modify background color #1198

Closed
zeroedin opened this issue Aug 14, 2023 · 2 comments
Closed

[bug] rh-card public css property to modify background color #1198

zeroedin opened this issue Aug 14, 2023 · 2 comments
Assignees

Comments

@zeroedin
Copy link
Collaborator

Currently the rh-card does not provide a public css property to modify background color --rh-card-background-color. This feature would support to proposed changes in #1188

@bennypowers
Copy link
Member

duplicating comments from the PR, for design review:

Before we merge this, it's worth considering weather it would be wiser to advise users to change the surface color tokens for a given card or class of cards, rather than providing an overriding background variable.

My reasoning is as follows: if we expose the background color variable to users, then users who wish to implement for example a dark background will skip the use of our color context system all together. That is likely to lead to maintenance difficulties, feature creep, and design and accessibility violations.

On the other hand, if we advise users who wish to apply a custom background to explicitly change the surface token values for a given card or class of cards, then they will have to explicitly participate in the context system. Because the context surface tokens have the words "on light" and "on dark" in their names, the user will be subtly encouraged to provide values for both theme variants.

This would have the added advantage of inheriting the provided values to the card's context-consuming children e.g. accordions, which in most cases would be desirable, and could be explicitly opted out of with a child selector

@brianferry
Copy link
Collaborator

Added docs to help developers customize background color through css tokens. Can be seen at the bottom of the page here https://deploy-preview-1200--red-hat-design-system.netlify.app/patterns/card/

@github-project-automation github-project-automation bot moved this from Backlog to Done in Red Hat Design System Sep 7, 2023
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

3 participants