Skip to content

Conversation

danbrady
Copy link
Contributor

Summary

Fix alignment in Footer Removes additional space that prevents the correct right alignment of elements.

Breaking change

This is not a breaking change.

Related issue

Resolves #5214

Preview link

Current state:
image

Proposed fix:
image

Problem statement

Additional padding on right side of footer within the secondary section could cause misalignment with other sections.

Solution

Modified HTML structure to use a layout that prevents additional padding/space. (No new styles/classes created.)

Testing and review

  1. Update was validated in browser across all breakpoint views
  2. Additional validation of correct layout across all breakpoints/platforms would be good! Or please let me know if there is automated visual regression testing that I should be using :)

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Looks like the issue is coming from the nested grid row's. Specifically .usa-footer__logo.grid-row.mobile-lg:grid-col-6 mobile-lg:grid-gap-2.

Maybe we should consider simplifying the markup by removing the grid rows for footer logo, social logos, and addresses. I know we kept the grid classes in Banner rework #5000, but there's a lot more here so worth removing.

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

@mejiaj Going off of your comment, it looks like there are margins being set by .grid-row.grid-gap>* that is causing that space on the right.

Should we consider this a breaking change because we're editing markdown?

@mejiaj
Copy link
Contributor

mejiaj commented Apr 17, 2023

@mejiaj Going off of your comment, it looks like there are margins being set by .grid-row.grid-gap>* that is causing that space on the right.

Should we consider this a breaking change because we're editing markdown?

Yes, it'd be a breaking change because of markup. I've added the Needs: discussion tag to the original issue, so we can discuss before making the change.

@danbrady
Copy link
Contributor Author

Happy to tackle simplifying the HTML/CSS upon your discussion. Let me know if we'd like to remove the grid utilities on just the sections @mejiaj mentioned, or the whole component. (Or any other requirements that emerge.)

@mejiaj
Copy link
Contributor

mejiaj commented Apr 27, 2023

@danbrady after discussing with the team let's move forward with removing grid classes from component ― starting with the problematic areas.

@danbrady
Copy link
Contributor Author

danbrady commented May 1, 2023

@mejiaj To confirm, the goal for the next step is to remove all grid classes from problem areas (footer logo, social logos, and addresses) and get equivalent layout using flex utilities, but leave the grid classes (and usa-layout-grid package) in for the rest of the footer(s)?

@mejiaj
Copy link
Contributor

mejiaj commented Jun 1, 2023

@danbrady sorry I missed this message.

Yes, we're keeping grid classes (to prevent breaking change), but removing the grid layout dependency in SASS.

@danbrady
Copy link
Contributor Author

danbrady commented Jun 2, 2023

No problem, @mejiaj! That's the direction I took. I have a WIP PR (#5289) for removing the grid dependency but need some guidance, when you have the chance. I'll tag you for review. Thanks!

@danbrady danbrady force-pushed the db-fix-footer-alignment branch from aa4b4bc to 724e1eb Compare August 4, 2023 21:26
@danbrady danbrady force-pushed the db-fix-footer-alignment branch from fd2853c to 2c43db2 Compare August 4, 2023 21:35
@danbrady
Copy link
Contributor Author

danbrady commented Aug 4, 2023

This updates the markup to remove the errant space defined in the issue. I've updated the markup, but only to use existing classes so I don't believe it's a breaking change? Thanks!

@danbrady danbrady requested review from mahoneycm and mejiaj August 4, 2023 21:56
@mahoneycm
Copy link
Contributor

Hey there @danbrady!

Any changes to component markup are considered breaking changes because they require users to manually update the markup in their component code.

It'd probably be a better idea to return to a scss based solution for this one.

Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

@danbrady thanks for creating this.

As @mahoneycm's mentioned; any markup changes would be considered breaking. Would you be able to follow his suggestion and use a SCSS-based approach?

@danbrady
Copy link
Contributor Author

danbrady commented Oct 3, 2023

Hi @mahoneycm / @mejiaj! Sure, I'll take a look and see if we can fix it with SCSS alone and not change any markup. We'll probably have to override grid/flex classes for this case.

So I understand for next time, can you explain to me why this instance would be a breaking change? I understand that if a user updates markup and it refers to updated CSS that hasn't been published it would actually break a component. However, while this change does change the markup, it only changes markup that refers to existing/unchanged styles. If it doesn't reference any new or changed classes, the change should operate ok whether the user updates the markup or not, no?

(BTW, I'm not disagreeing. Just want to learn :)

Note: PR updated!

@mejiaj
Copy link
Contributor

mejiaj commented Oct 3, 2023

@danbrady historically these types of changes bring difficulties to users, especially those on small teams trying to stay up-to-date with USWDS.

We're working on improving how we communicate breaking changes & how we can make upgrading easier. In the meantime, we're trying to avoid changing markup.

Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Short and effective! Love to see it. Thanks @danbrady ! Looks great

Copy link
Contributor

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

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

Nice scoped fix

@thisisdano thisisdano merged commit a6d0b0d into uswds:develop Dec 6, 2023
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.

USWDS - Bug: Agency contact center in the footer component is not right-aligned in the grid
4 participants