-
Notifications
You must be signed in to change notification settings - Fork 4
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
Styles: Cards in group have unequal image heights #949
Comments
Hey @Shashika6 thanks for working on this, I think I've phrased the problem incorrectly. The issue that @inesdgomes originally raised and that I misdiagnosed is that the images in the cards are different heights. In this situation, it's clear that longer words will force cards to be unequal widths. We can't control that, but we should be able to make sure that the heights of the images inside the cards remain the same. I'm going to close your first PR, because I don't think we should break words just to keep things the same width, that's a very blunt solution. Instead, what I'd recommend doing is, in the feature cards, add specific You'll want to carefully consult the Figma designs for this component to get as close as possible to the intended ratio between the images and the content area and then do lots of testing in Storybook to make sure that there aren't any edge cases that this breaks. Examples:
Let me know what you think. |
hey @justintemps, Tried implementing a fix for this with the flex rules that you provided and also tried a few other things but there is at least one case that breaks the card. Heres how it looks like for
|
@inesdgomes see @Shashika6's comment above. This seems like a complicated problem to fix, for a minor problem that only occurs when you're trying to squeeze four cards into a space where you should really only have three. I think we should close this issue, what do you think? |
Do we want to achieve something like this? Screen.Recording.2024-04-19.at.12.47.29.mov
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); |
Thanks @GGKapanadze, the The problem here is just that the image in the card changes height if one of the cards has to be wider than the others, because of some long word in the title. |
Hey team, I don't know if this could help or not but have we tried working with these breakpoints we created a while ago? This would solve the problem when we resize our screen because it should automatically move to a more "tablet" look https://www.figma.com/file/TnVsWy6VobbHzZdbHdx3Rb/ILO-Page-Templates?type=design&node-id=3980%3A44686&mode=design&t=cjmAwAxdGif8pRGI-1 @justintemps @GGKapanadze |
Cards in a card group have unequal width depending on their content. Instead, the width of all cards should be the same.
I think this is happening because the Card Group css uses
1fr
to allot space whereas it should probably use percentages instead. Example:repeat(4, 25%)
instead ofrepeat(4, 1fr)
See the cards in this example: https://www-preview.ilo.org/es/acerca-de-la-oit
The text was updated successfully, but these errors were encountered: