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

Style organisation logos with inline-block instead of flexbox #3308

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

AshGDS
Copy link
Contributor

@AshGDS AshGDS commented Aug 23, 2024

What / Why

Visual Changes

Before (one logo example)

image

After (one logo example)

image

Before (multiple logo example)

image

After (multiple logo example)

image

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3308 August 23, 2024 14:27 Inactive
@AshGDS AshGDS self-assigned this Aug 23, 2024
Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me overall, I like the approach of removing flex-basis from mobile and tablet, and wonder if it would be best to remove flex-basis from desktop as well. This would help keep the layout consistent across all screen sizes.

Non-blocking, but could also remove min-width and increase the margin-right to 30px to it still looks similar on desktop, and matches spacing between used on existing columns, something like that below for example:

.organisation-logos__logo {
  padding-bottom: govuk-spacing(3);
  margin-right: govuk-spacing(6);
}

@AshGDS
Copy link
Contributor Author

AshGDS commented Aug 27, 2024

Thanks @MartinJJones - was just thinking about removing flex-basis on desktop, if that's the case do you think it's worth removing display: flex entirely, and then just adding display: inline-block on the logos themselves so that they sit next to each other and then stack?

Good idea with the padding-bottom: and margin-right: - i'll use that 👍

@MartinJJones
Copy link
Contributor

MartinJJones commented Aug 27, 2024

was just thinking about removing flex-basis on desktop, if that's the case do you think it's worth removing display: flex entirely, and then just adding display: inline-block on the logos themselves so that they sit next to each other and then stack

I like this idea 👍

Looking at the existing code it looks like flex is used to try and create a 4 column layout, using flex-basis: 25% but this will only ever result is a max of 3 logos per row, because the margin-right: 15px increases it beyond the 25% width. This can be fixed, but will still likely result in more work to try and avoid the original issue.

So going with an option to let the logos always take up the space needed and have consistent spacing between them sounds like a good option to me.

@AshGDS AshGDS force-pushed the fix-org-logo-resize branch from 3f9141d to 2a3d7d8 Compare August 27, 2024 08:47
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3308 August 27, 2024 08:47 Inactive
@AshGDS AshGDS force-pushed the fix-org-logo-resize branch from 2a3d7d8 to de0adcc Compare August 27, 2024 08:48
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3308 August 27, 2024 08:49 Inactive
This prevents an issue where organisation names were wrapping too early
@AshGDS AshGDS force-pushed the fix-org-logo-resize branch from de0adcc to 8533392 Compare August 27, 2024 08:50
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3308 August 27, 2024 08:50 Inactive
@AshGDS
Copy link
Contributor Author

AshGDS commented Aug 27, 2024

Thanks @MartinJJones - i've made those changes. Here are the updated visual changes:

Before

image image

After

image image

Before

image image

After

image image

Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, looks like a nice improvement, especially the examples on mobile as well 👍

@AshGDS AshGDS merged commit 0107bf2 into main Aug 27, 2024
11 checks passed
@AshGDS AshGDS deleted the fix-org-logo-resize branch August 27, 2024 09:29
@AshGDS AshGDS changed the title Style organisation logos with flex-basis on desktop only Style organisation logos with inline-block instead of flexbox Aug 27, 2024
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

Successfully merging this pull request may close these issues.

3 participants