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: provider tokens and elements that don't set a default color-palette #147

Closed
zeroedin opened this issue Oct 18, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@zeroedin
Copy link
Contributor

zeroedin commented Oct 18, 2024

As of last release we generate acolor-context-provider.css file with the following contents:

:host([color-palette^="dark"]) { --context: dark; }
:host([color-palette^="light"]) { --context: light; }

:host([color-palette="lightest"]) {
  --rh-color-surface: var(--rh-color-surface-lightest, #ffffff);
}
:host([color-palette="lighter"]) {
  --rh-color-surface: var(--rh-color-surface-lighter, #f2f2f2);
}
:host([color-palette="light"]) {
  --rh-color-surface: var(--rh-color-surface-light, #e0e0e0);
}
:host([color-palette="dark"]) {
  --rh-color-surface: var(--rh-color-surface-dark, #383838);
}
:host([color-palette="darker"]) {
  --rh-color-surface: var(--rh-color-surface-darker, #1f1f1f);
}
:host([color-palette="darkest"]) {
  --rh-color-surface: var(--rh-color-surface-darkest, #151515);
}

These styles are included with components that are a color context provider. However some components do not default to setting their color-palette attribute, so --rh-color-surface does not get set in the above rule sets leaving that style undefined. Such an element is rh-tile as reported by Michael Wells.

I think we have 1 of 2 fixes.

In this repo:

:host(:not([color-palette])),
:host([color-palette="lightest"]) {
  --rh-color-surface: var(--rh-color-surface-lightest, #ffffff);
}

Or in RHDS every component that is a provider must specify and reflect a color-palette attribute by default.

Thoughts @bennypowers @markcaron

@zeroedin zeroedin added the bug Something isn't working label Oct 18, 2024
@zeroedin zeroedin self-assigned this Oct 18, 2024
@zeroedin zeroedin changed the title bug: provider tokens and elements that don't set a default color-palette bug: provider tokens and elements that don't set a default color-palette Oct 18, 2024
@zeroedin
Copy link
Contributor Author

We are going to fix this per component rather than at the token layer:

From slack:

bennyp [Oct 19th at 12:50 PM]
Best to add light as default in the element templates

Issue for tile
RedHat-UX/red-hat-design-system#2023

@github-project-automation github-project-automation bot moved this from Backlog to Done ☑️ in Red Hat Design System Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done ☑️
Development

No branches or pull requests

1 participant