Skip to content

Upgrade to Login.gov Design System v7#8093

Merged
aduth merged 16 commits intomainfrom
aduth-lgds-7
May 5, 2023
Merged

Upgrade to Login.gov Design System v7#8093
aduth merged 16 commits intomainfrom
aduth-lgds-7

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Mar 29, 2023

🛠 Summary of changes

This pull request implements the upgrade to the Login.gov Design System v7. This includes an upgrade of the USWDS from v2.13.3 to v3.4.1, incorporates a rename of the design system package from identity-style-guide to @18f/identity-design-system, and upgrades Sass syntax to support the new @use / @forward semantics required by USWDS v3.

Draft: This pull request depends on several upstream changes, including 18F/identity-design-system#331 and 18F/identity-design-system#321, and is not ready to merge. It's shared here as a demonstration of what the upgrade will look like, and to iterate toward further improvements prior to publishing v7 of the design system. Edit: The new, stable version of @18f/identity-design-system@7.0.0 is now published!

@aduth
Copy link
Contributor Author

aduth commented Mar 29, 2023

Problem 1: Long path references to LGDS and direct references to USWDS:

@use '@18f/identity-design-system/dist/assets/scss/uswds-theme' with (

"build:css": "build-sass app/assets/stylesheets/*.css.scss --load-path=node_modules/@uswds/uswds/packages --out-dir=app/assets/builds"

Problem 2: No direct support of new optimization options from USWDS.

Possible solution: Restructure published folder hierarchy of @18f/identity-design-system to mimic USWDS, pointing to original USWDS paths if unaffected, and including any relevant overriding styles.

node_modules/@18f/identity-design-system/
├─ packages/
   ├─ _usa-accordion.scss

Then change --load-path from node_modules/@uswds/uswds/packages to node_modules/@18f/identity-design-system/packages.

# Before:
# @use '@18f/identity-design-system/dist/assets/scss/uswds-theme' with ( 
# After:
@use 'uswds-core' with (
  # ...
);

@matthinz matthinz mentioned this pull request Apr 5, 2023
3 tasks
@aduth
Copy link
Contributor Author

aduth commented Apr 14, 2023

Observing an issue after upgrading with alert display, where the icon is not shown in full:

image

This appears to be related to an upstream issue I identified in USWDS which, combined with our use of LightningCSS postprocessor, results in a truncated icon (see uswds/uswds#5187 (comment)).

@aduth
Copy link
Contributor Author

aduth commented Apr 14, 2023

Observing an issue after upgrading with alert display, where the icon is not shown in full:

Temporary patch in efc6876.

@aduth
Copy link
Contributor Author

aduth commented Apr 20, 2023

One of the most interesting features of USWDS 3.0 is the ability to optimize the compilation by cherry-picking the individual component styles we need. I've added this in c53dff8 based on a quick pass at what we're currently using, and indeed it seems to have had a nice impact.

main: 46.2kb brotli'd
aduth-lgds-7: 29.5kb brotli'd
Diff: -16.7kb (-36.1%)

Comment on lines 25 to 33
Copy link
Contributor Author

Choose a reason for hiding this comment

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

aduth added 11 commits May 4, 2023 12:51
changelog: Internal, Dependencies, Upgrade Login.gov Design System to v7
Sass silently compiles missing functions as the verbatim original text
Used for backup codes & TOTP setup
Add missing media-block, collection
Pair down typography, helpers

regex: usa-(?!(accordion|alert|banner|button|collection|form|header|icon-list|icon|layout-grid|modal|nav|process-list|sidenav|skipnav|step-indicator|tag|verification-badge|success-message|character-count|checkbox|combo-box|date-picker|error-message|fieldset|file-input|form-group|form|hint|input-prefix-suffix|input|input-mask|label|legend|memorable-date|radio|range|select|textarea|time-picker|prose|list|sr-only|link))
aduth and others added 4 commits May 4, 2023 12:51
before { sign_in_and_2fa_user }

it 'allows a user to navigate between pages' do
# Emulate reduced motion to avoid timing issues with mobile menu flyout animation
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really neat!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I was pretty happy about this, both from the perspective that this should be a feature we support anyways from an accessibility perspective, and also that it's a nice hack to avoid animation timing prolonging the feature specs.

And it also highlights the DevTools features we can use. In particular, I'm really interested in the Accessibility APIs (see related code comment in #8327).

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