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

Use flexbox for share links with square icons #4316

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

AshGDS
Copy link
Contributor

@AshGDS AshGDS commented Oct 18, 2024

What / Why

  • Stop using columns: true for our square icons as it doesn't give us the visual balance we want where we're using it.
  • Therefore, use flexbox with a min-width for this variant instead.
  • The min-width is needed because alignment/stacking visual inconsistencies occur when the elements have varying widths. Therefore, if we ensure there is a minimum width for the elements, the alignment and flow when resizing is more visually pleasing. If you think of a component like our image cards, they stack and align nicely as they are all the same width, so we need some of that guarantee here, hence the min-width. It's also worth noting that columns: true was utilising a min-width for its balancing of links. I don't think we should be putting any max width type limitations though like columns does. (Mainly mentioning this as in the previous PR I originally used min-width, which was what led to back and forth conversation and alternatives being suggested.)
  • Trello: https://trello.com/c/mK8f3WMQ/93-adjust-share-links

Visual Changes

Before

image image

After

image image

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4316 October 18, 2024 10:23 Inactive
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4316 October 18, 2024 11:26 Inactive
@AshGDS AshGDS changed the title Use fixed height/width for share links with square icons Use flexbox for share links with square icons Oct 18, 2024
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4316 October 18, 2024 11:57 Inactive
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4316 October 18, 2024 11:59 Inactive
@AshGDS AshGDS marked this pull request as ready for review October 18, 2024 12:15
Copy link
Contributor

@JamesCGDS JamesCGDS 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 good! Got a couple of very minor comments. Also I tried a whole bunch of options trying to get this to work as per the designs (e.g. justify-content, playing with auto margins, playing with a grid layout) but I just couldn't get it to work nicely across all the different scenarios - I think this might be as close as we can get for the moment.

spec/components/share_links_spec.rb Outdated Show resolved Hide resolved
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4316 October 23, 2024 09:32 Inactive
Copy link
Contributor

@JamesCGDS JamesCGDS left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@AshGDS AshGDS merged commit 9ac258a into main Oct 23, 2024
12 checks passed
@AshGDS AshGDS deleted the share-links-tweaks branch October 23, 2024 10:07
@AshGDS AshGDS mentioned this pull request Oct 23, 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