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

Allow different colored Tile Components #4024

Open
statsgod opened this issue Sep 14, 2023 · 2 comments
Open

Allow different colored Tile Components #4024

statsgod opened this issue Sep 14, 2023 · 2 comments

Comments

@statsgod
Copy link

Is your feature request related to a problem? Please describe.
Background: I am working on a card stack like project where each card has a different background color: http://cameronbourke.github.io/react-cardstack/

I am trying to put various orbit components on the cards (e.g. Tile) but they look bad because they end being all white w/ only some of the card's background color showing.

Describe the solution you'd like
Ideally there'd be an option to set the color directly on the component or at least make the background transparent

Describe alternatives you've considered
I am aware that the white color can be themed, but as far as I know there is no solution to have each Tile have a different background color (or transparent to match the underlying card)

Additional context
It seems like in general it is discouraged to style Orbit components, but for the case of background colors the spec is too rigid:
https://orbit.kiwi/development/guides/no-exporting-components/

@mainframev
Copy link
Contributor

mainframev commented Sep 15, 2023

@statsgod Hello 👋🏻

Currently, we do not support setting the background color via props on Tile

You mentioned theming the white color, I'd say it's not a good idea as it won't help you and will break the usage of the token. On our side, it has to be replaced with the appropriate Tile token instead: theme.orbit.paletteWhite -> theme.orbit.tileBackground. But that won't help you as well, because you need multiple colors.

I'd suggest you have custom wrapper above the Tile that will rewrite the background colors as a workaround

@statsgod
Copy link
Author

statsgod commented Jan 27, 2024

for anyone interested, I worked around this with:

`svg[class^="Icon__StyledIcon"] {
background: transparent !important;
}

div[class^="ItineraryIcon"], div[class^="TileWrapper"] {
background: transparent
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants