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

Upgrade USWDS from v3.4.1 to v3.6.0 #362

Merged
merged 3 commits into from
Sep 29, 2023
Merged

Upgrade USWDS from v3.4.1 to v3.6.0 #362

merged 3 commits into from
Sep 29, 2023

Conversation

aduth
Copy link
Member

@aduth aduth commented Jun 16, 2023

Upgrades USWDS to its latest version, from 3.4.1 to 3.6.0.

Release notes:

Also updates dependabot.yml to change the dependency name (the npm package was renamed from uswds to @uswds/uswds in v3.0.0), since the purpose of the configuration is to automate these updates.

Blocked: There's a build issue that needs to be sorted out. Also reported upstream at uswds/uswds#5334 . Edit: This is now fixed in USWDS 3.6.0.

CHANGELOG.md Show resolved Hide resolved
@aduth aduth force-pushed the aduth-uswds-3-5-0 branch from 2c4cf25 to f591c80 Compare August 29, 2023 18:34
@aduth aduth changed the title Upgrade USWDS from v3.4.1 to v3.5.0 Upgrade USWDS from v3.4.1 to v3.6.0 Aug 29, 2023
@aduth aduth marked this pull request as ready for review August 29, 2023 18:35
@aduth
Copy link
Member Author

aduth commented Aug 29, 2023

Checks aren't triggering 🤔 Will try closing and reopening.

@aduth aduth closed this Aug 29, 2023
@aduth aduth reopened this Aug 29, 2023
@aduth
Copy link
Member Author

aduth commented Aug 29, 2023

3.6.0 changed some details around disabled colors which is triggering the visual regression failure and inverting the disabled button color. I'll need to investigate.

Before: https://federalist-340d8801-aa16-4df5-ad22-b1e3e731098e.sites.pages.cloud.gov/site/18f/identity-design-system/buttons/
After: https://federalist-340d8801-aa16-4df5-ad22-b1e3e731098e.sites.pages.cloud.gov/preview/18f/identity-design-system/aduth-uswds-3-5-0/buttons/

Before After
image image

Setting 'disabled-dark' as white will probably get us in trouble, we should revisit the disabled colors
@aduth
Copy link
Member Author

aduth commented Aug 30, 2023

@nickttng When you have a moment, I might want to tag you in here to weigh in on a couple things:

@nickttng
Copy link
Member

@aduth

Anti-aliasing
Did USWDS note a reason(s) why they have removed the anti-aliasing effect? The outcome with the extra boldness is noticeable and jarring in some places. I am okay with restoring the anti-aliasing until we know why it was removed.

Disabled button colors
Aligning to USWDS' change makes sense here. I generally see more disabled button patterns as dark text on a light/gray background. It is distinctive from our current primary/default buttons with a solid dark background.

@nickttng
Copy link
Member

@aduth When it's merged, I'll update the disabled buttons in the Figma library.

@aduth
Copy link
Member Author

aduth commented Aug 31, 2023

Did USWDS note a reason(s) why they have removed the anti-aliasing effect?

I traced it back to the work here: uswds/uswds#5250

Related issue: uswds/uswds#5180

They mention one of the reasons is it being unsupported: https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth

I'm not really compelled by the case, though I also wonder if it's a battle worth fighting, considering that everything seems stacked against the use of this style. I'm also not sure how much effort it'd be to bring back for all the places it may have been removed, so I'll take a look.

@aduth
Copy link
Member Author

aduth commented Sep 29, 2023

Couple updates here:

  1. Moved to greater alignment on disabled colors with USWDS (see example)

I tried to approximate this as close as possible with our "grey" color family, but it's somewhat lighter than USWDS. That's because USWDS uses gray-20 as their starting point for "lighter", whereas "lighter" is typically associated with -10 on the color scale, incrementing next to gray-30 as "gray-light". I chose to opt for semantic alignment (i.e. "disabled-lighter" = "grey-lighter"), but this means it's the equivalent of a grey-10. We could opt for darker by bumping up the scale (i.e. "disabled-lighter" = "grey-light" = "grey-30") if we wanted.

@nickttng Any thoughts here? Personally I think it could work as-is.

  1. On the point of font-smoothing:

I'm feeling like it's a losing battle to try to keep the font-smoothing:

  1. Maintenance overhead of diverging from USWDS
  2. It's only supported in specific browsers and operating systems (i.e. Apple operating systems), which could end up being a gap in our awareness for how many of our users experience our sites
  3. The general sentiment around it is not positive[1][2], including some compelling arguments toward it altering the intended/ideal representation of fonts
  4. Maybe the contrast is especially jarring since we're comparing side-to-side, and it won't be as problematic after we've come to adjust to it

One possible compromise I'm wondering is if we should consider changing some bold font weights to normal. I was actually surprised that button text is bolded by default (from USWDS)? Maybe overriding that to normal font weight could make the change less noticeable.

Bold, with font smoothing (original) Bold, without font smoothing (current branch) Normal, without font smoothing (idea)
image image image

Obviously this just applies to buttons, but maybe (a) that's the most "problematic", and (b) are there others we could do similar? e.g. navigation current link.

@nickttng Are you okay with dropping the font smoothing? Any interest in the idea above to override font weight for buttons?

@nickttng
Copy link
Member

@aduth Thanks for the context

@nickttng Any thoughts here? Personally I think it could work as-is.

Yes, it works as-is

@nickttng Are you okay with dropping the font smoothing? Any interest in the idea above to override font weight for buttons?

Yes, okay with dropping the font smoothing. The normal w/o font smoothing appears to be a better approach than the bold w/o font smoothing. My concern with the normal version for the danger version is that its contrast ratio (4.7:1) is near the edge of inaccessibility (Under 4.5:1) and with the decreased weight, it might be more difficult to read. I wonder if that's one of the reasons USWDS proceeded with the bold(er) approach, visually.

What do you think about proceeding with what USWDS has established? And we would keep an eye out via user feedback / usability studies?

@aduth
Copy link
Member Author

aduth commented Sep 29, 2023

What do you think about proceeding with what USWDS has established? And we would keep an eye out via user feedback / usability studies?

If you mean (1) dropping font smoothing and (2) keeping the default bold text, then yes, I'm okay with that, and it simplifies things to stay in alignment with USWDS 👍

In which case, all of that should be reflected in the current preview branch, so I think we're good to move forward if we're okay with everything there?

https://federalist-340d8801-aa16-4df5-ad22-b1e3e731098e.sites.pages.cloud.gov/preview/18f/identity-design-system/aduth-uswds-3-5-0/buttons/

@nickttng
Copy link
Member

In which case, all of that should be reflected in the current preview branch, so I think we're good to move forward if we're okay with everything there?

Yep, with 1) dropping font smoothing and 2) keeping the default bold text. 👍🏼

@aduth aduth merged commit 5b23799 into main Sep 29, 2023
@aduth aduth deleted the aduth-uswds-3-5-0 branch September 29, 2023 15:58
@aduth
Copy link
Member Author

aduth commented Sep 29, 2023

I may hold off temporarily on publishing a new version, since I believe a new patch release of USWDS should be landing soon. Their monthly newsletter from 10 days ago mentioned a 3.6.1 release on the horizon.

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